TreadBot


Closed Thread
Results 1 to 40 of 177

Thread: TreadBot

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dragons_fire View Post
    i just gave that a try, and it does the same thing.... im going to haved to play around with it a little more later... the pijng sensor im using, only has one I/O pin, it actaully takes the "trigger pulse" in and then waits 200uS and then sends out the ultrasonic pulse, so that part of the code was copied right out of their demo code for the BS2. i have had it working before on a 877a, so i just copied my code from that.. im sure its just a stupid little thing... it actually seems like maybe the baudrate is just a tiny bit off, but i can send the first command fine...
    Can you slow down your SERIAL LCD? (notice how I remembered it was a serial lcd this time?) Run it at 2400 baud instead of 9600, or maybe slower, and see what happens?

  2. #2
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    when i use: pulsin portf.0, 5
    it should put pin f.0 high for .005 seconds right??? i am really realizing how much i dont know about this stuff. most of my robots have been made by trying different code until it works. on this one, i am learning a little more code but i still dont know how all this works..
    heres the code:

    DEFINE OSC 20
    TRISF.1 = 0

    'variables
    '----------------------------------------------------------------------------------

    baudLCD CON 32 'baud rate for lcd
    lcd VAR PORTF.0 'lcd port
    ping VAR WORD
    ultra VAR PORTF.1

    Low PORTF.1
    High PORTF.0
    ping = 0

    'Startup Program
    '-------------------------------------------------------------------------------------- 'start motor driver

    Pause 3000 'pause for LCD startup screen 'reset motor driver 'wait a few seconds
    SerOut2 lcd, baudlcd,[254,"X"] 'clear screen
    Pause 100
    SerOut2 lcd, baudlcd,[254,"X"] 'clear screen again
    SerOut2 lcd, baudlcd,[254,"P",140] 'change resolution
    SerOut2 lcd, baudlcd,[254,71,1,1,"Ping Test"] 'display test on lcd in position 1,1

    'main program
    '----------------------------------------------------------------------------------------

    start:

    PulsOut ultra, 5 'send trigger to ping
    PulsIn ultra, 1, ping 'wait for ping variable

    Pause 1000

    SerOut2 lcd, baudlcd,[254,71,5,3,DEC ping," "]

    Pause 1000

    GoTo start
    End


    and heres a video or whats happening...
    http://s163.photobucket.com/albums/t...adbotultra.flv
    unfortunately, its not easy to see the LCD screen, so it may not help much


    thanks for all the help...

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    RF0 is AN5
    RF1 is AN6/C2OUT

    So these might help.
    Code:
    ADCON1 = $0F
    CMCON = 7
    <br>
    DT

  4. #4
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    once again, you are amazing!!! i know somehow that makes then digital instead of analog, but i havent ever figured out how all that works...

    maybe there will be a video later on...

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Cool

    Then I wouldn't worry about the A/D stuff right now. So far none of your project will be using analog. So you can just leave them turned off.

    I think you've got "Bigger Fish to Fry".

    If you do add analog stuff later, just take a look at the ADCON1 register (19-2) in the data sheet. There's a table that shows what values to use for whatever analog inputs you need. Same for CMCON.
    <br>
    DT

  6. #6
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    i definately have a lot of "frying" to do!!! i enjoy the challenge of trying to make this stuff work but sometimes its nice to have help from you guys that know what you are doing.

    i have another small problem right now. i used if/then (i know they arent the best way to do stuff, but its easy) statements so if the distance is more than "900" then it will drive fast, if its lower than "900" then it will slow down, and if its lower than 350 it will stop and turn, then drive fast again until it senses something..

    so it will drive fast, and then when it gets to under "900", it slows down, but then it stays at that speed, and it doesnt send out pings.

    im almost positive that im either missing something or things arent in the right order.

    im going to play around with it a little more before i "officially" ask for help. that way i can learn all the things that dont work!!!

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