im newbie in this arduino world and i need help for my arduino project
so i want to make the program to works like this:
the LED wont turn on after i put the text 'A' on virtual terminal, it needed to push a button first to let me turn on the LED by writing 'A' after i push the button, but the LED wont turn on when i only push the button
i kept stuck on when i put text 'A' first then push the button the LED will turn on but when i push the button first then put 'A' LED wont turn on. its in reverse
When you send 'A' to your program from the IDE monitor, you are actually sending 'A' and then '\n' so your program is reading two characters inside the while() loop. This means, the first Serial.read() returns 'A' which turns ON the LED and waits 3 seconds, and then turn the LED OFF
blh64:
When you send 'A' to your program from the IDE monitor, you are actually sending 'A' and then '\n' so your program is reading two characters inside the while() loop. This means, the first Serial.read() returns 'A' which turns ON the LED and waits 3 seconds, and then turn the LED OFF
So will it be worked? Im still stuck with this code, if i separate the if(digitalRead) with if(Serial.available), but wont it be separated too? Like i dont need to push a button to turn on the light, i just need to put 'A' right?
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.