Need help with my final project in engineering
ChaseH19
Posts: 1
I'm using a Parallax Board of Education (2000-2006) and need to control two servos with two potentiometers. The potentiometers I need to use aren't the ones the board comes with, they look like the one attached below...
I understand how to control a single servo with one potentiometer (Chapter 5 Activity 4 in "What's a Micro-controller" book by Parallax)
I need help with how to properly wire the board and the code for it. I have found other people's posts asking for similar things but not exactly what I need.
Thanks Guys!
I understand how to control a single servo with one potentiometer (Chapter 5 Activity 4 in "What's a Micro-controller" book by Parallax)
I need help with how to properly wire the board and the code for it. I have found other people's posts asking for similar things but not exactly what I need.
Thanks Guys!
Comments
If you can control one servo, you can control two. I won't give you code, but will suggest a strategy
1) Read 1st pot
2) Convert pot reading to compatible servo value
3) Generate pulse to first servo
4) Read 2nd pot
5) Convert pot reading to compatible servo value
6) Generate pulse to second servo
7) Wait about 17 milliseconds
8) Back to Step #1
With the pulses and 17 milliseconds delay, you get about 20 milliseconds between updates (this is fine -- doesn't have to be exactly 20ms).
It makes a difference what you are writing code in; Spin or C. The code snippets
in the OBEX are mostly Spin. I am using a book on Spin, "Programming the
propeller with Spin; a beginner's guide to parallal processing." Gives alot
of code and schematics on what you are looking for. I am writing a program
that requires measuring pulses, which involved the counters, A & B. In the
code that I have seen, counters are used in controlling the counters too.
Good luck!
Dude - the OP is using a Stamp, not a Propeller.
(...Andy beat me to it!)
No frowning from this participant! Paypal $1000 to me and I'll send you all the code you desire.
JK, you wouldn't want very much help on your final in Engineering. Treasure the challenge!
(You would enjoy the propeller too!)
Place your meter in the 20K range and you should see the value go from a low value to around 10K as you turn the pot clockwise, assuming your pots are also 10K.