Étape 4: Logiciel de récepteur :
#include < SoftwareSerial.h >
#include < LiquidCrystal.h >
Innovente lcd (12, 11, 5, 4, 3, 2) ;
#define BT_SERIAL_TX 6
#define BT_SERIAL_RX 7
SoftwareSerial BluetoothSerial(BT_SERIAL_TX, BT_SERIAL_RX) ;
temp de char = ' ' ;
void setup()
{
Serial.Begin(9600) ;
LCD.Begin (16, 2) ;
LCD.Print ("température ambiante:") ;
BluetoothSerial.begin(9600) ;
}
void loop()
{
Si (BluetoothSerial.available() > 0)
{
Temp = BluetoothSerial.read() ;
lcd.setCursor (0, 1) ;
LCD.Print(temp) ;
LCD.Print (« degré ») ;
Delay(100) ;
}
}