Shop OBEX P1 Docs P2 Docs Learn Events
Storing large number — Parallax Forums

Storing large number

eecs189eecs189 Posts: 10
edited 2006-03-10 04:59 in BASIC Stamp
What's the best way to store large numbers in BS2? What I the microcontroller to do is calculate milliseconds. My group is designing an ultrasound range finder. When we receive our time using RCTIME command, it's in milliseconds. We want it to multiply the time by speed of sound which is 343 meters per second. If the pulsewidth happen to be beyond 131 milliseconds, is there a way to display the correct value of the distance?

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-10 04:59
    How about multiplying by 0.343 (see the */ and ** operators) since you've already got a value in milliseconds.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.