Shop OBEX P1 Docs P2 Docs Learn Events
Need help with my final project in engineering — Parallax Forums

Need help with my final project in engineering

ChaseH19ChaseH19 Posts: 1
edited 2014-12-09 16:05 in BASIC Stamp
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!
259 x 194 - 6K

Comments

  • JonnyMacJonnyMac Posts: 9,014
    edited 2014-12-08 12:19
    Most participants frown on youngsters asking for help with their homework.

    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).
  • mklrobomklrobo Posts: 420
    edited 2014-12-08 14:03
    Alot of good code projects are in the OBEX section of this forum.(upper top right).
    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! :)
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-12-08 14:11
    I think he is using the Stamp BOE, since this is the Stamp Forum.
  • davejamesdavejames Posts: 4,047
    edited 2014-12-08 14:11
    mklrobo wrote: »
    Alot of good code projects are in the OBEX section of this forum.

    Dude - the OP is using a Stamp, not a Propeller.

    :smile:

    (...Andy beat me to it!)
  • ercoerco Posts: 20,256
    edited 2014-12-08 15:58
    JonnyMac wrote: »
    Most participants frown on youngsters asking for help with their homework.

    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!
  • mklrobomklrobo Posts: 420
    edited 2014-12-09 05:25
    Oops! :( Alot of help I am with the basic stamp! Sorry about that.
    (You would enjoy the propeller too!)
  • GenetixGenetix Posts: 1,749
    edited 2014-12-09 16:05
    The center pin of your pot should be the Wiper and the left pin should be terminal A though I would verify this with a multimeter.
    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.
Sign In or Register to comment.