Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Sponsor

Zero to 32 bits in 10 minutes.
Take the fast track with Stellaris® ARM© Cortex™-M3 evaluations kits.

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | Re: Timer() loses time

Discussion forum for the BasicX family of microcontroller chips.

Re: Timer() loses time - Frank Manning - May 19 16:02:00 2004

From: Neil Jepsen <>

> [...]as soon as I realised that timer was not losing
> time, my "game_time" was incorrect.. I've repeated
> the offending code below, and the fix. [...]
>
> if (timer>=p) then
> p = timer + 1.0
> game_time=game_time - 1 ' bump clock each second
> end if

Yes, the good ole floating point roundoff error.

BTW this is why BasicX allows only discrete counters in
for-loops.

-- Frank Manning
-- NetMedia, Inc.


______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )