Stap 5: De Software van de ontvanger:
Yazılım Geliştirme door Robimek-2015
Yazılım Lisans door 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 char = ' ';
VOID Setup
{
Serial.begin(9600);
BluetoothSerial.begin(9600);
myservo.attach(10);
}
void loop
{
Als (BluetoothSerial.available() > 0)
{
Val = BluetoothSerial.read();
int servoAng = val – '0';
myservo.write(servoAng);
}
}