#define switchPin 8 // 8 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(switchPin,OUTPUT); } void loop() { if(digitalRead(switchPin) == HIGH) // When the switch is pressed print '1' on the Serial buffer Serial.println(1); else //Else print '0' Serial.println(0); }