NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Sensors, Actuators, and Robotics » Servo reverse rotation/ positioning problem.
April 08, 2012 by rmore |
Hello All! I think I am making some progress with all the electronics stuff that I have been playing with before I build a simple robot! I have a question regarding positioning a Servo. I did go through the 3 servo related questions posted in this forum but none of them quite answered my question directly. My servo has to rotate clockwise and anticlockwise successively. It does rotate at the start...and after securing its position it then just makes a whining sound when i switch a button to reverse its rotation. The code is as follows:
Thanks for your replies in advance. |
---|---|
April 08, 2012 by pcbolt |
rmore - There is some source code on the Nedkits tutorial page that deals with this. You'll just have to add in your own controls. Here is the link...the source code link is near the bottom of the page. The comments in the code explain quite a bit. |
April 08, 2012 by missle3944 |
Rmore, Try to use the code that the nerdkits gave you. If you have the serial line setup then you will be able to manage your servo very easily! Just build off their code! -Dan |
April 26, 2012 by rmore |
Hello! I went through the Servo Squirter code and I did not understand a few things in it. I would appreciate it if somebody could please clarify some things in the code. %%%%%%%%%%%%%%%%%%% At the start of the code, there is a function defined 'pwm_set'.
Why is OCR1B used in this block of code? We already have OCR1A for generating the PWM. Please explain the usage of OCR1B here. %%%%%%%%%%%%%%%%%%%% What is the following part of the code doing? What are the ']' and '[' for? What is pos+/- = 25?
%%%%%%%%%%%%%%%%%%%%%% I am sorry if I am asking silly questions....but I am just not getting this. I am trying to move my servo in one direction when a photoresistor outputs a value higher than some x value and move the servo in different direction when the value is lower than x. So i started going thru the code for servo squirter and came across these questions. Thank you. RMORE |
Please log in to post a reply.
Did you know that inductors try to keep their current constant over short periods of time? Learn more...
|