Subject:
|
Re: sending files to pbForth - results
|
Newsgroups:
|
lugnet.robotics.rcx.pbforth
|
Date:
|
Fri, 19 Nov 1999 22:48:40 GMT
|
Viewed:
|
1499 times
|
| |
| |
Hi Vlad,
In lugnet.robotics.rcx.pbforth, Vlad Dumitrescu writes:
> but, when using POWER_INIT and POWER_OFF standalone, the display remains lit,
> showing 4th...
These commands are low-level calls to ROM firmware. If you want to simulate
original firmware' behaviour you mast do a little coding.
May be you will be interested to see my small example at the end of this post.
This is the part of my monitor I'm using to control RCX, and it simulates look
and feel of original monitor (only "4th" instead of small man figure on
LCD ;).
BTW, when you call POWER_OFF word directly, the RCX will be really switched
off and will stay in this state until you will not press On/Off button.
> and when running TEST_POWER from the supplied scripts, the RCX suddenly (at the
> fourth step) did not want to come up again at all... it is dead - and it's not
> the batteries, since removing them and putting them back brings it back to
> life.
I'm sorry to tell it but there were few bugs in 1.0.7 samples (so, seems also
in 1.1.0). I think it happened because button API has been changes, but few
scripts remain unchanged. Here they are:
testlight.txt, torbalall.txt, torbot.txt, tracker.txt
I'm really sorry what I was so lazy and didn't report about this on time...
Another reason - many things will not work if you will not call RCX_INIT (and
company) before. In case you have played with POWER_OFF... This word resets
RCX, so you need to re-init everything again. (see example below).
Sergey
-- pbForth code ---------------------------------------------------------------
\
\ on-off.f
\ RCX on/off monitor
\
BASE @ HEX
GET-CURRENT NONSTANDARD-WORDLIST SET-CURRENT
\ RCX utilities
: RCX-INIT-ALL ( -- )
RCX_INIT
POWER_INIT
BUTTON_INIT
SENSOR_INIT ;
: POWER-BUTTON? ( -- flag )
RCX_POWER DUP 4000 POWER_GET @ 0= ;
: LCD-SPLASH ( -- )
LCD_4TH LCD_REFRESH ;
: PLAY-SOUND-AND-WAIT ( sound-nr -- )
4003 SOUND_PLAY
BEGIN RCX_SOUND DUP SOUND_GET @ 0= UNTIL ;
\ power
: rcx_boot ( -- )
RCX-INIT-ALL
LCD-SPLASH
1 PLAY-SOUND-AND-WAIT ;
' rcx_boot TO 'boot \ init RCX every time the pbForth restarted
: rcx_power_off ( -- )
0 PLAY-SOUND-AND-WAIT
LCD_CLEAR LCD_REFRESH
RCX_SHUTDOWN
POWER_OFF
rcx_boot ;
\ monitor task
0 32 CELLS 32 CELLS HAT rcx_on_off_task
rcx_on_off_task BUILD
:NONAME
RCX-INIT-ALL
LCD-SPLASH
rcx_on_off_task ACTIVATE
BEGIN
POWER-BUTTON? IF rcx_power_off THEN
PAUSE
AGAIN ; EXECUTE
SET-CURRENT
BASE !
-- end pbForth code -----------------------------------------------------------
|
|
Message has 1 Reply: | | Re: sending files to pbForth - results
|
| Hello. I became acquainted with pbforth via Jonathan Knudsen's (O'Reilly) books and think that it's a terrific place to learn forth. I am using CRT with line delay=100 and char delay=20, but if I wait between carriage returns, I get "garbage" I (...) (25 years ago, 21-Nov-99, to lugnet.robotics.rcx.pbforth)
|
Message is in Reply To:
| | Re: sending files to pbForth - results
|
| i tried, and indeed CRT works much better. but, when using POWER_INIT and POWER_OFF standalone, the display remains lit, showing 4th... and when running TEST_POWER from the supplied scripts, the RCX suddenly (at the fourth step) did not want to come (...) (25 years ago, 19-Nov-99, to lugnet.robotics.rcx.pbforth)
|
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|