Hi Folks,
I'm going to lose my mind a little, been at this for a few hours. Trying to get a 315mhz receiver working with an Adafruit Trinket (which has an ATTiny85). I used to have this working, and now I can't figure out what I'm doing wrong. When I take the data out pin and connect it to an Arduino Uno, I am receiving data just fine. As soon as I connect it to the Trinket, no matter which pin I use, the Trinket isn't receiving data from then Rf Receiver.
Appreciate any help!!!
Here's my code:
#include <SendOnlySoftwareSerial.h>
#include <VirtualWire.h>
#define RECEIVE_PIN 2
SendOnlySoftwareSerial Serial(0);
void setup() {
vw_set_ptt_inverted(true);
vw_set_rx_pin(RECEIVE_PIN);
vw_setup(4000);
vw_rx_start();
Serial.begin(9600);
}
void loop() {
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) {
char ReceiveMsg[4];
for (int i = 0; i < buflen; i++) {
ReceiveMsg[i] = char(buf[i]);
}
ReceiveMsg[buflen] = '\0';
int ReceiveData = atoi(ReceiveMsg);
Serial.println(ReceiveData);
} else {
Serial.println("No Data!");
}
}