anthony8i:
ok so how can I write a sketch that; say I have led13 on and on my main arduino and second arduino reads if its on or off? or how can I turn the ledpin13 on or of using a switch? gives 1 or 0 on my monitor and the second arduino reads that?
So say you have a switch hooked up to your master and want that to control an LED on the slave. First hookup the RX/TX lines and ground as previously stated
On your master, read the state of the button. Send that data across the serial line. (You get the opportunity to write your own protocol!).
On your slave, read any data from the Serial line and if it matches your protocol, then set the LED's state based on the data you received.