To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 37
36  |  38
Subject: 
RE: SENSOR_READ doesn't return 0
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Fri, 16 Apr 1999 02:12:34 GMT
Viewed: 
1757 times
  
Actually, whils I am re-coding things, is there any reason why you
didn't do DELAY like this?

: DELAY ( 100msec timer -- )
  0 OVER TIMER_SET SWAP          ( timer ticks )
  BEGIN
    OVER TIMER_GET OVER >        ( timer ticks time>ticks )
  UNTIL
  2DROP
;

There are indeed many ways to skin a cat...in the end , the effect
is the same, but I'm always curious to see how others do things.

How many FORTH programmers does it take to screw in a light bulb?
Just one, but he has to be the fellow that screwed it in in the first place!

I have produced an interim millisecond timer:

: Sleep ( msec -- )
  0 DO
    [ DECIMAL ] 143 0 DO LOOP \ calibrated
  LOOP
;

Excellent....I'll try to get the multitasking working this weekend...

Cheers,

Ralph Hempel - P.Eng

--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.bmts.com/~rhempel/lego/pbFORTH/default.html>
--------------------------------------------------------
Reply to:      rhempel at bmts dot com
------------------------------------------------------



Message is in Reply To:
  Re: SENSOR_READ doesn't return 0
 
Actually, whils I am re-coding things, is there any reason why you didn't do DELAY like this? : DELAY ( 100msec timer -- ) 0 OVER TIMER_SET SWAP ( timer ticks ) BEGIN OVER TIMER_GET OVER > ( timer ticks time>ticks ) UNTIL 2DROP ; I have produced an (...) (25 years ago, 15-Apr-99, to lugnet.robotics.rcx.pbforth)

10 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR