I'm doing a communication system with 2 Arduinos Leonardo. To transmit I had to convert a String in bits and send them trough a PWM pin. The question is, how can I do the receiver?
My idea is to receive data in a digital pin, so I can convert LOW/HIGH to '0' and '1', put 8 bits in a string, convert to char and then I have my final String.
Any help/suggestion would be appreciated.
EDIT:
- I'm using PWM because I want to implement FSK modulation, sending bit by bit;
- I have some hardware to get communication system working;
- My physical channel for communication is Serial (via Arduino pins);
- In the receiver hardware will provide me TTL signals, so I will have 0V/5V. That's why I think digitalRead() should work;
- Data is sent via PWM and received in two level signals;
- I'll have to do some protocol to send/receive data, still don't know how.. ;