09-17-2020 11:45 PM
Hello everyone,
My problem may look naive but I seek your guidance.
I am logging analog data from a sensor using Arduino Mega controller. I have set the update rate to be 1 second. I also need to generate an alarm when reading exceed a certain value. But due to loop cycle, I get alarm only after loop execution which may take 1 second. Is there a way to code so that my data gets updated once per second but alarm condition is monitored and responded as fast as possible?
Thanks
Arihant
09-18-2020 12:38 AM - edited 09-18-2020 12:45 AM
How fast can you read the board?
You can read 10x faster only update/store once a second...
I would do that alarming on the Arduiono btw.... maybe on both ... if you can't read the values the arduino is down 😉
SO program the arduino to read the sensor as fast as possible, send a message once a second and immediatly in case of a passed boundary condition. in LabVIEW you have a event loop with 2s timeout and read the value and do (additional) alarming in case the ardiono send an alarm or hasn't send since 2s ....
Alarm on an analog value is easy to program in solder with a 555 😄