Odo-meter for Knight Rider.


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Oh...

    Can admin move this threat for me?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by captain nguyen View Post
    Oh...

    Can admin move this threat for me?
    Can you find the Proton Basic forum section here?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Do you mean "mel PIC BASIC Pro"?
    If yes, but how can I move this threat?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by captain nguyen View Post
    Do you mean "mel PIC BASIC Pro"?
    If yes, but how can I move this threat?
    There is no THREAT here.

    Apparently, you are NOT using MeLabs PicBasicPro. You are using PROTON Basic.
    Try again.
    Or maybe you expect somebody to covert a Proton Basic program to PicBasicPro for you?

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


    Did you find this post helpful? Yes | No

    Default

    Or maybe he just doesn't realize the Proton forum is at ...

    http://www.picbasic.org/forum
    <br>
    DT

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Too Old To Change And Outta Beer . . .

    Hello Captain,
    I'm not fluent even in PBP much less Proton, but here is what I see . . . Looks like you found some code that controls the display for the Odometer, I do not see anything here which does the math of turning 8000 counts into 1 mile. What I do see is this code writes to and reads from the eeprom and displays that on the 7 segment display, you would need to add some math routines to convert. In this case you know 8000 pulses = 1 mile so 8000/1.61 = 4968.944
    not quite 5000, rounded up to 4969. Set up a 16 bit timer, preloaded with the difference between 65535 and 4969 and when it overflows you have traveled 1km, you will likely have to adjust that number some to account for "latency" in the pic while you are reloading the number in the timer. Oh, it is THREAD not Threat.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Looks like you found some code that controls the display for the Odometer, I do not see anything here which does the math of turning 8000 counts into 1 mile. What I do see is this code writes to and reads from the eeprom and displays that on the 7 segment display, you would need to add some math routines to convert. In this case you know 8000 pulses = 1 mile so 8000/1.61 = 4968.944
    not quite 5000, rounded up to 4969. Set up a 16 bit timer, preloaded with the difference between 65535 and 4969 and when it overflows you have traveled 1km, you will likely have to adjust that number some to account for "latency" in the pic while you are reloading the number in the timer. Oh, it is THREAD not Threat.
    I don't think you'd really need any sort of timer unless you were trying to convert the odo input into a speed output. If it's just an odometer pulse input (which we're not even sure if the O/P is able to read that input in the first place), then it is just a simple matter of counting.
    If you do know it is actually 8000 pulses per mile, then yes, you are right in that 8000 / 1.61 = 4968.944.
    But since PBP can't do fractional numbers, and to add a bit more accuracy...
    km_travelled = ( pulses_total * 412 ) / 2048
    and to make it execute just a bit faster
    km_travelled = ( pulses_total * 103 ) >> 9
    Therefore, if you get 8000 pulses,
    8000 * 103 / 512 = 1609 = 1.609 kilometers.

    Hopefully this user's actual compiler (whether it be Proton or PBP) is capable of LONG (32 bit) variables, because using the above example, this will overflow after 13.18 kilometers. If a 32 bit variable is available, it'll be capable of counting up to 431,912 km's.

Similar Threads

  1. Hall Effect flow meter with 16F876
    By revelator in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th March 2010, 21:42
  2. VU Meter
    By Andre_Pretorius in forum General
    Replies: 4
    Last Post: - 20th May 2009, 17:17
  3. PIC10F206 - What is the LOWEST Power @ Rest or Sleep
    By rixtalbert in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 18th March 2007, 15:42

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