I am able to successfully send the binaries from RF transmitter using below code but at the same time, I want to read the data from RF transmitter data PIN to see what data it is sending on serial monitor.
Can someone help??
I think digitalread function is to read only 0 or 1 but I want to read the total string coming from that data pin or tx pin of arduino
/*
Example for different sending methods
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
// Transmitter is connected to Arduino Pin #10
mySwitch.enableTransmit(13);
}
void loop() {
mySwitch.send("000000000001010100010001");
delay(1000);
mySwitch.send("000000000001010100010100");
delay(1000);
long read= digitalRead(13);
pinMode(read,INPUT);
Serial.print(read);
}
RTFM. digitalRead() returns HIGH (1) or LOW (0). There is no excuse for storing that one bit in a 32 bit variable.
Now, a long long, that would be a different story.
If mySwitch.send() diddles the output pin, don't you suppose that there just might be some corresponding method to deal with the input pin being diddled with? Why do you think that you need to re-invent the wheel?