Software > Software

expressing a decimal in PBASIC

<< < (2/4) > >>

555 timer chip guy:
so tell me if I have this right:

if I wont to pause for 1.5 ms I could use this command  PAUSE 2/3 ???

nanob0t:
I have no clue.   Try looking for information on the web first.

If not, give the program a try like that and see if you get any errors, or if the program doesn't like to your wishes.

Maybe, if the programming language supports it, try () to encase the number.

Or perhaps, if you use this number once, and if the programming language supports it, try defining a variable at the beginning to be 3/2 or 1.5.  Then you can just say  PAUSE (Insert Variable Here)

A few ideas that may work.

Somchaya:
Actually, from what I know, most languages will treat 3 / 2 as an integer division, and return an integer, so 3/2 = 1 in this case.

If you need to do a pause for fractions of a second, but the function like pause only accepts seconds, then it is unlikely that it'll work. Instead, there might be another function that will take in milliseconds or some smaller division.

Again, I'm not familiar with PBASIC, but I'm guessing through my experience with other languages, and playing with QBasic a long time ago (no idea if it's related to PBASIC though).

Another suggestion would be to try google for "pause fraction of second" or something like that.

JonHylands:

--- Quote from: 555 timer chip guy on April 02, 2007, 10:22:18 AM ---so tell me if I have this right:

if I wont to pause for 1.5 ms I could use this command  PAUSE 2/3 ???

--- End quote ---

Since the units are milliseconds, there is no way to do anything other than whole milliseconds with PAUSE.

If you're trying to control an I/O pin for a specific length of time, you could use PULSOUT. Otherwise, you need to use a better microcontroller that has higher timing resolution.

- Jon

555 timer chip guy:
thank you for you  help

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version