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);
}
}
Nah, mate. I studied all those from our community and Arduino community. So far I could understand Serial. ParseInt(). This is way I currently convert string from MIT.
This is a great help! I just updated the Arduino code and also make a few changes to MIT App. So far I got weird behavior from the servo motor.
1 the servo motor is vibration itself when I don't slide.
2 the acting speed of the servo motor is far behind I push the slider to the left or right.
The servo motor is to be set to 90 degrees because I need to keep it stays at the middle. Then I could decrease or increase the degree to control the car turn left or right.
after all, I learned a lot from this great community and I get my horizontal joystick works fantastic! but I got a problem with the servo motor. as you can see it shakes when it's at 90 degrees. what will cause this problem? I have scratched my head day by day and I could not figure it out.