I have a very simple setup with an Arduino Uno R3 connected to my Windows 7 x64 with Arduino 1.0.1.
I have a RF receiver connected to the Arduino on the DI10 port using the SoftwareSerial library. I am using a AM-RRQ3-433 module. See AM
When I receive a byte from the RF receiver, I am simply writing it to the Serial (so that I can see it on my PC in the serial monitor). The rf.available() function rapidly increases to 63 and thus I have a lot of 0's printed.
The Arduino code is as follows:
#include <SoftwareSerial.h>
#define rxPin 10
#define txPin 11
SoftwareSerial rf(rxPin, txPin);
int incomingByte = 0;
void setup() {
pinMode(rxPin, INPUT);
Serial.begin(57600);
rf.begin(2400);
}
void loop() {
if (rf.available() > 0) {
incomingByte = rf.read();
Serial.println(incomingByte, DEC);
}
}
As a side note, if I remove the pinMode(rxPin, INPUT) line then nothing is ever received (and rf.available() is always 0).
To debug this, I've tried removing the Serial.println call and instead turning the onboard LED on depending on rf.available().
The LED is constantly turned on, suggesting that rf.available() > 0. Even if I only turn it on when checking rf.available() >= 63.
I've used a voltmeter to measure over GND and the data pin (DI10). While measuring I saw 0V (as per the specification of the RF module).
I have also tried to invert the signal on the SoftwareSerial constructor (the third argument), but this does not change anything but the byte written becomes 255 rather than 0.