Beginner + Servo


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jul 2007
    Location
    Maryland, USA
    Posts
    15

    Post Beginner + Servo

    Hello,

    Am in my first month of learning to program, and have completed most projects in the " PicBasic Projects - Book, by : Dogan Ibrahim ".

    I am currently trying to control a servo motor(Tower Hobbies: STD TS-53) via a toggle switch. Switch one way to turn the servo Clockwise, opposite position for Counter Clockwise. Center position to center the servo

    when power is applied my servo spins to the center and then vibrates and will not respond to switch. I am new and looking to learn, if I am using code improperly please inform me, I dont want to start off on the wrong foot.

    using pic16F648, my code is as follows :
    Code:
    'PICBasic pro manual servo control program

    symbol switchCW = porta.1
    symbol switchCCW = porta.0
    symbol servo = portb.0


    Position var byte


    start:

    'look at switches on Port A
    IF switchCW = 1 and switchCCW = 1 then goto loop

    Position = 150
    Pulsout servo, Position
    pause 18

    loop:
    if SwitchCW = 0 then
    Position = 130
    Pulsout servo, Position
    Pause 18
    endif

    If SwitchCCW = 0 then
    Position = 170
    pulsout servo, Position
    Pause 18
    endif

    Pause 18
    Goto loop
    *****************
    end of program....

    Thank you, for any feedback
    Last edited by james; - 31st July 2007 at 20:46.

Similar Threads

  1. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 08:40
  2. saving RCREG to word
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 13:51
  3. Problem with 12F629, servo and EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 1st March 2008, 09:53
  4. Servo does not move
    By ruijc in forum General
    Replies: 12
    Last Post: - 12th November 2007, 19:14
  5. Help with Servo Control Please!
    By wireman22 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 18:15

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts