Étape 5: Logiciel de récepteur :
Yazılım Geliştirme de Robimek-2015
Yazılım Lisans par Robimek
www.robimek.com
#include < SoftwareSerial.h >
#define BT_SERIAL_TX 4
#define BT_SERIAL_RX 3
SoftwareSerial BluetoothSerial(BT_SERIAL_TX, BT_SERIAL_RX) ;
#include < Servo.h >
Servo myservo ;
Servo myservo ; val As char = ' ' ;
void setup()
{
Serial.Begin(9600) ;
BluetoothSerial.begin(9600) ;
myservo.Attach(10) ;
}
void loop()
{
Si (BluetoothSerial.available() > 0)
{
Val = BluetoothSerial.read() ;
int servoAng = val-« 0 » ;
myservo.Write(servoAng) ;
}
}