hey, am trying to implement a simple visible light communication using on transmitter side arduino uno,LED and on the receiver side am using another arduino with a photodiode to interpret the output of LED.
the problem i have now is on the transmitter side, as i want to use serial communication line pin o(rx) and pin 1(tx) to transmit transmit and receive data throught light. how can i use pin1(tx) to output high and low on an attached LED according to the ouputted bit?
MY CODE
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println('h');
delay(3000);
}
After uploading to the board, i disconnected the arduino and plugged to the external power,i want the existing code to keep sending bits of 'h" and convert those bit into high and low to blink the led and be received by photodiode. thanks
After uploading to the board, i disconnected the arduino and plugged to the external power,i want the existing code to keep sending bits of 'h" and convert those bit into high and low to blink the led
Well, you are in luck then, because that is what that code will do.
and be received by photodiode.
You can't, on the sender end, make the receiver do anything.
All YOU need to do now is to write the code to receive the data.
Look up what baud rate means. Look up what format Serial sends data in - how many start bits, parity, etc. Then, figure out how long each HIGH or LOW will last, at 9600 baud.
Then, determine how long it takes for you photodiode to react to a change in light level. If that time is longer then the HIGH time to send a bit, you are sh*t-out-of-luck reading data with that device.
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html
Have you googled arduino light communications
a cornucopia of different projects.
Tom.. 