I just start this project and find It doesn't work. I created a slider and seems it's gonna send values to Arduino. I currently want to use this slider to control the servo motor, but I got no luck. any help would be appreciated.
UCCApp.aia (1.6 MB)
#include<SoftwareSerial.h>
#include <Servo.h>
Servo myservo;
SoftwareSerial BT(10, 11); // RX, TX
int Position ;
void setup()
{
myservo.attach(4);
//BT.begin(9600);
BT.begin(9600);
}
void loop()
{
if (BT.available() > 0)
{
int Position = BT.read();
Position = map(Position, 0, 180, 0, 180);
myservo.write(Position);
//delay (100);
}
}