05-06-2025 02:19 PM
Hi! I'm having troubles with this little program and cannot find a solution, anyone have a clue?
So it's really simple, I just have an arduino with a button and I want labview to read that data and store an image whenever that button is pressed
The arduino program is this one
The arduino works perfect, just sends the ''1'' character to serial monitor in the IDE. But the trouble is that the case structure never gets a true value... If anyone could provide help I'll very much appreciate it.
Thanks!
05-06-2025 03:03 PM
I see you are using "Bytes at Port", I suggest you watch this video: VIWeek 2020/Proper way to communicate over serial
05-07-2025 12:53 AM
Hi Zuz,
@Zuzguluddi wrote:
The arduino program is this one
int boton=2;
void setup() {pinMode(boton, INPUT);Serial.begin(9600);}
void loop() {if(digitalRead(boton)==HIGH)Serial.println("1");
delay(200);}
So your Arduino only sends "1\n". And it sends that string only when the button is "HIGH"…
I recommend to send "0\n" additionally when the button is "LOW". Otherwise the message receiver need to handle timeout errors to detect the 2nd button state!