#define led 9 // 9 coz it makes the wiring easier void setup() { //NOTE :- Both the Atmegas should have the same baud rate Serial.begin(4800); // 4800 baud coz....thats what i would suggest after experimenting ...i think the 16 mHz crystal was not able to handle 9600 baud...may be 20 Mhz crystal could do it pinMode(led,OUTPUT); } void loop() { while(Serial.available() == 0); //Loops in this line until the funtion gets any data from the Serial buffer char data = Serial.read(); if(data == '1') // Check if the data is valid or not, if(true) .....Sets Led HIGH digitalWrite(led,HIGH); else //Else, set Led LOW .....signifying no valid data transmitted digitalWrite(led,LOW); }