i am doing a LIFI kinda project in which a string is converted into binary array and is transmitted .
if the Boolean value is 1 led will be ON for 50ms else if 0 its OFF for 50ms.
the transmitter is working properly. In the receiver i kept a photo diode which is connected anologe pin A0
and im able to receive the same binary data but i dont know how to convert it back to string.
if i receive 10000000 it should display -a
10000001 -b and so on.(ASCII encoding)
can u please help
Thank YOU
Try hooking the led up to TX of the sender and hook the detector to RX of the receiver and use Serial to handle the communications? Softserial should do the job fine, maybe start at 300 baud (300 bits, 30 bytes with a start and stop bit for each per second) to see if the detector is fast enough?
Just know that serial bits are HIGH for 0 and LOW for 1. The libraries and hardware handle that but if you go checking the light, it will be ON as the "carrier" (goes all the way back to telegraph) and all 0 bits.