Étape 12 : Arduino émetteur Software
#include < VirtualWire.h >
#include < dht11.h >
. #define DHT11PIN 2
dht11 DHT11 ; char msg [6] ;
void setup()
{
vw_setup(2400) ;
vw_set_tx_pin(3) ;
}
void loop()
{
chk int = DHT11.read(DHT11PIN) ;
int [email protected] = DHT11.temperature ;
nem int = DHT11.humidity ;
sprintf (msg, « %d, %d », [email protected], nem) ;
vw_send ((uint8_t *) msg, strlen(msg)) ;
vw_wait_tx() ; Delay(1000) ;
}