My project is to control the LED by send '1' or '0' via serial monitor.
My task for this project is when '1' is send via serial monitor, the Led ON PIN 3 need to blink until '0' is send via serial monitor, the LED will be turn off. Then, when next '1' is send , the Led ON PIN 3 will blink again. But it doesn't work for my code. This is my first time to use arduino, can anyone tell me what is wrong in my code and help me to do some correction . Below is my code:
Arduino to control LED using serial monitor
My task for this project is when '1' is send via serial monitor, the Led ON PIN 3 need to blink until '0' is send via serial monitor, the LED will be turn off. Then, when next '1' is send , the Led ON PIN 3 will blink again. But it doesn't work for my code. This is my first time to use arduino, can anyone tell me what is wrong in my code and help me to do some correction . Below is my code:
Code:
char data = 0;...