How would i write this in pic basic pro (Servo controller)


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default reply

    hi there thanks for the reply.

    Input 1 is an analouge input and input 2 is a pwm signal from a futarba reciver.

    the clock frequeny is 4mhz with this make a big differance to the code and what would it look like?

  2. #2
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default reply

    hi there here is the code i have at the moment

    'servo control prog

    'set variables

    ch1 var byte
    ch2 var byte
    s1 var byte
    s1 = 150

    start:

    pulsin portb,1,7000,Ch1
    pot portb,2,200,Ch2

    if ch1 < s1 then output1
    if ch1 > s1 then output1
    if ch1 = s1 then output2


    output1:

    pulsout portb.3,ch1
    pause 18
    goto start

    output2:

    pulsout portb.3,ch2
    pause 18
    goto start

    end

    i have compiled it and it seams to work. not tried it out on any hardware yet .

Similar Threads

  1. PIC BASIC or PIC BASIC PRO
    By kirkmans in forum USB
    Replies: 3
    Last Post: - 20th April 2007, 00:52
  2. Turbo Encoding with Pic Basic Pro
    By obaskirt in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 15th November 2006, 09:22
  3. converting assemble to pic basic pro
    By Jhdgkss in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th April 2006, 19:55
  4. PIC basic and rc servo signals
    By BCIcdrz in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 11th May 2003, 14:51
  5. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07

Members who have read this thread : 0

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