How to display digital output from arduino to Matlab GUI using static text

2 次查看(过去 30 天)
Hi,
The idea is when I touch the button at pin 2 Arduino the output shows 1 and release the output shows 0 (continuously). Below is the arduino code.
int pinTouch1 = 2;
void setup() { pinMode(pinTouch1,INPUT); Serial.begin(9600); }
void loop() { digitalRead(pinTouch1); int touchState1 = digitalRead(pinTouch1); Serial.print(touchState1); delay(100); }
The problem is 1) I don't know to use either edit text or static text. 2) What is the code use to display the output?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for Arduino Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by