![]() | ||
| Home | SwiftX Archive | SwiftForth Archive | |

At 08:57 PM 8/9/2003 +0200, Viviane.Beullens wrote:
>Hi,
>
>I wrote a little program that lets the leds
>sequentially flash (see code below).
>
>I'd like now to stop, to start and to reset the
>flashing leds after pushing several switches.
>Normally I would create a table and store execution tokens
>in it. The usually way to do it is with the ' (tick),
>for instance:
>' stop buttonstable !
>
>But tick seems not to work. Does anyone know how it can be done?
I don't see how you're using ' here, but there are several things
to be careful of. You can use ' interpretively when in TARGET
mode to construct a table, but you must remember that your
target dictionary has no heads nor search capability, so
' or ['] cannot be executed by a TARGET definition.
Example:
TARGET
CREATE BUTTONS ' FOO1 , ' FOO2 , ' FOO3 ,
>...
>: /TESTER ( -- )
> $FF DDRB C! \ Set PORTB as OUTPUT
> $FF PORTB C! \ set leds off at start up
> TESTER BUILD TESTER ACTIVATE
> BEGIN PAUSE SEQBITFLASH
> AGAIN ;
Potential problem here: the reason BUILD and ACTIVATE are
separate functions is that BUILD should only be done once
after startup in the target. It constructs the RAM task table,
so once is enough. ACTIVATE starts the task doing
something. Better to put the BUILD in code executed by
START. Then you could execute /TESTER more than once
if you wanted to (e.g. if you had another word to stop the
task).
Cheers,
Elizabeth
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com
"Forth-based products and Services for real-time
applications since 1973."
==================================================
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
For list command help, send subject "help" to swiftx-request_at_forth.com
Message archives are located at http://www.forth.com/archive/swiftx
----------------------------------------------------------------------
This list is a forum for SwiftX users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Sat Aug 09 2003 - 13:53:44 PDT
This archive was generated by hypermail 2.2.0 : Mon Dec 01 2008 - 03:04:47 PST