I’m trying to use the SparkFun RFLink 434MHz with the Manchester library, specifically RWS-371-6 Receiver and TWS-BS-3 Transmitter, but I can’t get anything to work. Current receiver code:
// This #include statement was automatically added by the Particle IDE.
#include "SparkIntervalTimer/SparkIntervalTimer.h"
// This #include statement was automatically added by the Particle IDE.
#include "Manchester/Manchester.h"
#define RX_PIN D3
#define LED_PIN D2
#define KILL_OUT D4
#define KILL_IN D5
uint8_t moo = LOW;
void setup() {
// Delay in case I f* something up
delay(5000);
// Initialize led pin for output
pinMode(LED_PIN, OUTPUT);
// Turn it off
digitalWrite(LED_PIN, moo);
// Init killOn and killOf
pinMode(KILL_OUT, OUTPUT);
pinMode(KILL_IN, INPUT_PULLDOWN);
// Make sure killOut has power
digitalWrite(KILL_OUT, HIGH);
// Setup Manchester Library
man.setupReceive(RX_PIN, MAN_4800);
man.beginReceive();
}
void loop() {
uint8_t receiveComplete = man.receiveComplete();
if(digitalRead(KILL_IN) == HIGH){
Spark.publish("Receive Complete",String(receiveComplete, DEC));
}
if(receiveComplete) {
uint16_t msg = man.getMessage();
if(digitalRead(KILL_IN) == HIGH){
// Check to see if the message was for me
Spark.publish("In byte",String(msg, DEC));
}
if(msg == 10) {
// Turn LED on
digitalWrite(LED_PIN, HIGH);
}
}
}
Transmitter code is basically straight out of the example as well, but using pin D1 instead of D2.
Any and all help would be appreciated, even if it’s pointing out that I’m doing everything wrong… I was assuming this would be much more painless than it has turned out to be (spent a day using Serial1/2 an the TX/RX until I started looking for libraries).
Thanks.