So my servo motor doesn’t rotate clockwise, and when I try to turn it anticlockwise it just makes a buzzing sound. all cables are wired correctly (have checked 100 times). tried to unassemble the motor in case it was an internal problem but I found nothing strange.
probably not the problem here is the code anyway:
#include <SoftwareSerial.h>
#include <Servo.h>
Servo myservo; // servo name
int bluetoothTx = 10; // bluetooth tx to 10 pin
int bluetoothRx = 11; // bluetooth rx to 11 pin
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo.attach(6);
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop()
{
if(bluetooth.available()> 0 ) // receive number from bluetooth
{
int pos = bluetooth.read();
Serial.println(pos);
myservo.write(pos);
delay(100);
}
}
Please help meeeeeeeee 
Hey @Marco_19041
A pretty common way to troubleshoot an issue is to try to simplify and isolate the issue as much as possible.
In this case, I suggest you to remove all the other components beside the Arduino and the servo motor.
Make sure the Arduino can run the servo properly.
You can try the following test code and see if your servo works properly:
https://www.arduino.cc/en/Tutorial/sweep
1 Like
It works fine… Guess is the code then. But what can it be?
It could be from what is received via Bluetooth.
I connected a led to see if it was initiating the “if” statement, worked fine, but the servo didn’t.
don’t know what I can do now…
You can open the serial monitor and take a look at what the Bluetooth module is sending when you move the servo. This will help you verify if the value / data you are sending is correct for int pos.
it is sending the correct values: 90,0
What is the servo that you are using exactly?
Can you send a picture of your setup too?
http://www.mertarduino.com/servo-motor-control-via-bluetooth-app-inventor/2018/11/19/
I followed this guide. Same code, same app, wired it the same way. The servo is still not working.
Hey Marco,
Can you send a picture of your setup too?