I have load in arduino uno an example program to control RGB leds. Sending a string by usb leds switch on. I open arduino serial monitor tool and usb works: I send a string 255,127,35 and leds switch on to correct ligth intensity. Now I send the same string by Hyperterminal but leds don't switch on.
In arduino program the end of string is '\n'. In fact by serial monitor tool I set 'NL'. Can you help me?
What does Hyperterminal send at the end of the string ?
Maybe send a user input such as # at the end of the string and detect that in the Arduino code instead of ‘\n’ or if Hyperterminal sends a Carriage Return detect ‘\r’
Have a look at the examples in serial input basics - simple and reliable.
#define RELAY1 7
Serial.begin(9600); // set serial speed
pinMode(RELAY1, OUTPUT); // set LED as output
int val = Serial.read() - '0';
if (val == 1)
Serial.println("relay status on");
else if (val == 0)
Serial.println("relay status OFF");
here simple code you can modify accordingly as per your requirement
[here simple code you can modify accordingly as per your requirement
@AMPS-N, you seem to be addicted to the unnecessary complexity of the watchdog timer.
I have an Atmega 328 running for about 2 years now without any WDT code.