Simple Servo Control Question - Need to write simple subroutine
BotleRocketWar
Posts: 1
Hey Guys,
I'm working on a small project and am having some issues with servo control.
I was hoping I could get some help with two small subroutines. I'm using the Basic Stamp 2 and the Board of Education. I am wanting to·create a subroutine that will, from neutral, rotate the servo approximately 30 degrees for 1 second, and then return to neutral.
Then I need another subroutine that will, also from neutral, rotate the servo in the OPPOSITE direction approximately 30 degrees for 1 second and then return to neutral.
This will be used to control the control surface of a small aircraft for the purpose of demonstrating a simple auto-pilot based on a few photoresistors.
Thanks!
I'm working on a small project and am having some issues with servo control.
I was hoping I could get some help with two small subroutines. I'm using the Basic Stamp 2 and the Board of Education. I am wanting to·create a subroutine that will, from neutral, rotate the servo approximately 30 degrees for 1 second, and then return to neutral.
Then I need another subroutine that will, also from neutral, rotate the servo in the OPPOSITE direction approximately 30 degrees for 1 second and then return to neutral.
This will be used to control the control surface of a small aircraft for the purpose of demonstrating a simple auto-pilot based on a few photoresistors.
Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
If you haven't already, also take a look at Chapter 4 in What's a Microcontroller. It provides an in-depth explanation of the standard servo, and how to control it using the BASIC Stamp 2.
Best of luck, and let us know how it turns out!
-- Jessica
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jessica Uelmen
Education Department
Parallax Inc.