I am receiving data from Arduino via Bluetooth with the HC-06 module and I would like to activate a green label when the data is one (a physical button is pressed) and when the data is zero (the button is not being pressed ) show a label in red
Here is a simple BlueTooth text receiver sample, for single value per line:
...
Use println() to send your ones and zeroes, and test the message variable.
1 Like
I mean that when a zero is sent, a label turns red and a label turns black. When the button reading is one, the one label turns green and the one that was red turns black (black so that it cannot be seen, since the background is black)
Use the button background color.
Do you not know how to use an 'if' block?
The truth is, I have done the test several times and I don't get the if, so since it is my first application, I have tried to learn but I don't really know why it doesn't work.