The messages received by the Arduino take the form: $ Ba, Pb, Rc #
Where $ represents the beginning of the message, # represents m, and B, P, and R are characters representing B button, P period and R repetition.
- `a 'designates the button to be read, which can be 1, 2 or 3.
- `b 'designates the time (in seconds) that the button should be expected to be pressed.
- `c 'designates the number of times the button is expected to be pressed during the indicated period.
For example, with the message: $ B2, P4, R2 # you want to know if button 2 has been pressed twice for four seconds. If condition is verified, then the Arduino must send the message $ MSG, TRUE # where MSG represents the message received without the start and m message characters. Otherwise, you must send the message $ MSG, FALSE #.
Incoming messages must respect the format presented. If not, the condition is not checked and the message $ NOK, MSG, KON # must be sent as a response.
I have no idea how to do this since im new to arduino