Society of Robots - Robot Forum
Software => Software => Topic started by: Its_Friday on February 08, 2009, 12:31:58 PM
-
I am trying to figure out PWM for servos but i haven't been able to find example code for the axon microcontroller. All i have found are .hex files for centering servos, and i can't read .hex xD
-
http://www.societyofrobots.com/member_tutorials/node/228 (http://www.societyofrobots.com/member_tutorials/node/228)
-
I have already read that and understand the under lying principles of PWM but i don't know how to code PWM for servos.
-
This section talks specifically about servos and PWM http://www.societyofrobots.com/member_tutorials/node/231 (http://www.societyofrobots.com/member_tutorials/node/231)
It includes code for a 1MHz ATMega8
So if you are using a 16MHz Axon then follow the example as it explains what varies according to the CPU frequency.
The reference section shows tables for the ATMega8, 168, and Axon. So you can translate each of the register names from the example into the equivalent registers for the Axon.
-
i'm interested in simple source code which uses the axon source code functions. I'm a novice at programming and am unfamiliar with registers. :-[
-
Check out my PWM for Servos on the Axon...
http://www.societyofrobots.com/robotforum/index.php?topic=5590.0 (http://www.societyofrobots.com/robotforum/index.php?topic=5590.0)
-
Check out my PWM for Servos on the Axon...
http://www.societyofrobots.com/robotforum/index.php?topic=5590.0 (http://www.societyofrobots.com/robotforum/index.php?topic=5590.0)
thank you. Worked like a charm.
-
If you run out of PWM ports, do this:
http://www.societyofrobots.com/axon/axon_function_list.shtml#hardware_defines