PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default My point is decimal

    I do write SONAR proximity results in EEPROM. I use the WRITE command. It comes out in HEX with reversed words. Here is an example:

    Address 00 contains BC
    Address 01 contains 02
    This reads as BC 02 when looking at the EEPROM readout.

    These are HEX and they are reversed. They represent:
    $02BC = 256x2 +16x11 + 12 = 512 + 176 + 12 = 700decimal

    Take 2/3 of 700 and get about 48 inches. I do that with in my head or with scratch paper.

    Your system of dividing 700 by 14.8 gets 47.29 inches. My brain can figure out "two thirds of" easier.

    I want addresses 00 and 01 to look like 4729, or preferably rounded down to 0047 or up to 0048. Can PBP do that?

    Ken

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    I want addresses 00 and 01 to look like 4729, or preferably rounded down to 0047 or up to 0048.
    This will write asci to your eeprom data. Your PicKit2 can be set to read data as asci with the little drop down box. By the way, I hope you are not writing to the eeprom each time a distance is measured, because you will wear your chip out pretty quick that way.

    Code:
    distance var word
    inches var byte
    distance = 700
    distance = distance * 10
    distance = distance + 74        'add half of divisor (148) , this is not  needed, but will "round up" if you want to be a little more accurate
    inches = distance / 148
    
    
    write 0,61                      'For "=" (standard asci character set)
                                    'the + 48 changes it from dec to asci
    write 1, inches dig 2 + 48      'will be a "0" if inches = 47
    write 2, inches dig 1 + 48      'will be a "4" if inches = 47 
    write 3, inches dig 0 + 48      'will be a "7" if inches = 47
    Then you can view it like this:
    Name:  inches.PNG
Views: 1101
Size:  41.7 KB
    Last edited by ScaleRobotics; - 28th November 2010 at 15:58.
    http://www.scalerobotics.com

  3. #3
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default New video. Model car races Toy car

    Today I brought both of my PIC controlled cars to the old gym to see how they fared together on the same track. Here's the video. Which do you think was the winner? Remember the TOY car is red. The MODEL car is blue. The TOY cost originally cost $50. The MODEL cost $200. Both have my kit.



    What do you think? Should I show it on Access Television?

    Ken

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    They look pretty much equal to me.
    What if you took some paste board and made the corners a radius?

    Overall they look good!!
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Potential solution to bang-bang steering

    I have a new plan to control the much faster 1/10 scale toy car which is fast, but does not contain proportional controls. The trick is to turn the wheels only for a short period of time (150 msec at the moment) then 'kick' (supplement the springs) them back to neutral.

    If the neutral is well calibrated (the 1/10 cars have a knob that centers the wheels) this method makes the car turn with little swerve. I need this while wall following. Otherwise the car crashes into the wall before the code/DPDT relay/steering wheels can react.

    I'll make a video if this really works.

    Ken

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Great Idea Ken
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Worked for me

    Originally Posted by mackrackit :
    I just drove home trying to simulate Ken's car. Pulsed the same degrees left or right, more pulses left or right for turns but always the same, say 5 degrees off center, and after each pulse returned to center.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

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