So i'm trying to code a servo motor to turn left when a button is pressed and turn right if another button is pressed i already have a code for it on the servo.h library but it has a problem with the virtualwire.h library and through browsing on the net i found that i can use ServoTimer.h to replace it but the problem is i dont know how to control the servo on that particular library.

Please Help.

  • The ServoTimer2 library also contains an example, that shows how to use it. Basically it's the same principle: Create one instance for each servo and call the write() function to set the servo to a specific position. Do you understand this example? – chrisl Jul 23 '18 at 13:09
  • I dont understand this part int incPulse(int val, int inc) – Underhanded CODE Jul 23 '18 at 13:26
  • and also the if statement below it – Underhanded CODE Jul 23 '18 at 13:26
  • This is only for incrementing the servo value, it is not essential for the library. The important part is only the write – chrisl Jul 23 '18 at 14:16
  • so in the servo.h library to change the servo angle it would be myservo.write(0); would it also be the same on the ServoTimer2 library? or would it change? – Underhanded CODE Jul 23 '18 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.