Below all info about the project
#include <Servo.h>
Servo panServo, tiltServo;
void setup() {
panServo.attach(9);
tiltServo.attach(6);
Serial.begin(38400); }
void loop() {
if(Serial.available()>= 2 ) {
unsigned int servopos = Serial.read();
unsigned int servopos1 = Serial.read();
unsigned int realservo = (servopos1 *256) + servopos;
Serial.println (realservo);
if (realservo >= 550 && realservo <750){
int servo1 = realservo;
servo1 = map(servo1,550,750,10,170);
panServo.write(servo1);
Serial.println(servo1);
delay(10);
}
if (realservo >= 250 && realservo <450){
int servo2 = realservo;
servo2 = map(servo2,250,450,170,10);
tiltServo.write(servo2);
Serial.println(servo2);
delay(10);
} } }
Everything connected as on the schematic , only I connected the RX and Tx both , don't think this is a problem , on the schematic only the TX is connected
The app works as it should, can connect bluetooth, can move the joystick and see the x and y coordinates change
The only thing that doesn't work is the combination of app and arduino
There is no movement in the servos, the bluetooth led flickers slowly which is good, but no movement in the servos when I move the joystick
Who can help me please