Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char data_rx;
- int bitDelay = 1000;
- int halfBitDelay = 1500;
- int rx = 2;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- pinMode(rx,INPUT);
- }
- void loop() {
- delayMicroseconds(halfBitDelay);
- for (int offset = 0; offset < 8; offset++) {
- delayMicroseconds(bitDelay);
- data_rx |= digitalRead(rx) << offset;
- }
- Serial.print(data_rx);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement