Paso 13: Arduino receptor Software
#include < VirtualWire.h >
int sicaklik;
int nem;
int i;
char x;
char StringReceived [6];
void setup() {Serial.begin(115200);
vw_set_rx_pin(11); vw_setup(2400);
vw_rx_start();
}
void loop()
{
if(serial.Available() > 0)
x=serial.Read();
uint8_t buf [VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if(x=='1′)
{
Si (vw_get_message (buf & buflen))
{
para (i = 0; i < buflen; i ++)
{
StringReceived [i] = char(buf[i]);
}
sscanf (StringReceived, "%d, %d", & sicaklik, y nem);
Serial.println(sicaklik);
Delay(500);
Serial.println(NEM);
Delay(500);
memset (StringReceived, 0, sizeof (StringReceived));
}
}
}