Servo only does 90 degrees
-
Hello all,
This night I finally made some time to build a gateway and a device to use a servo.
The only issues I had was finding drivers to programm the nano and the uno ( I use the uno for the servo).Now , there is 1 issue. The servo only turns max 90 degrees. I uploaded the sketch without changing anything.
http://www.mysensors.org/build/servoIt should to a full 180 degrees I think ? it is a standard futaba S3001.
The servo is good ( I checked with my RC transmitter and reciever)anyone has an idea how to troubleshoot?
edit ... oh ... that's wierd... when I use the slider or open-close , it does the 90 degrees. but when I click up-down, it does full 180 degrees ...... why not with the slider??
thanks,
Cor
-
Just recieved a responce via another forum.
I ran in the same problem. I fixed it by replacing the line:
myservo.write(SERVO_MAX + (SERVO_MIN-SERVO_MAX)/100 * val); // sets the servo position 0-180
by the following 2 lines of code:
val = map(val, 0, 100, 0, 180); // scale 0%-100% between 0 and 180) myservo.write(val); // sets the servo position 0-180
Suggested Topics
-
Day 1 - Status report
Announcements • 23 Mar 2014, 22:45 • hek 24 Mar 2014, 20:12 -
Forum Search not working?
Troubleshooting • 4 Oct 2023, 23:33 • Gibber 2 Sept 2024, 20:28 -
Compiling Sensor code using BME280 and ESP8266
Troubleshooting • 26 Feb 2025, 00:32 • dpcons 26 Feb 2025, 06:22 -
Can not compile MySensors on esp8266
Troubleshooting • 24 Aug 2024, 15:35 • TheoL 29 Aug 2024, 20:47 -
Ghost Child
Troubleshooting • 28 days ago • FcNanoLed 25 days ago -
NODs stop responding, but ping works.
Troubleshooting • 8 Mar 2025, 19:47 • Marcin 8 Mar 2025, 19:47