I changed a few things and now I am receiving numbers but the numbers do not make sense when I print them. It looks like this:
Message Received
0
77
25
990
My receiving code looks like this:
#include <VirtualWire.h>
int data[5];
int temp;
int tempc;
int pressure;
int humidity;
void setup() {
Serial.begin(9600);
vw_set_rx_pin(12);
vw_setup(4000);
vw_set_ptt_inverted(true);
vw_rx_start();
pinMode(13,OUTPUT);
}
void loop() {
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if(vw_get_message((uint8_t *)data, &buflen))
{
temp = data[0];
tempc = data[1];
pressure = data[2];
humidity = data[3];
Serial.println("Message Received");
Serial.println(temp);
Serial.println(tempc);
Serial.println(pressure);
Serial.println(humidity);
}
}
Is there some way I am messing up the order of the variables?