|
-----Original Message-----
From: John Cooper [mailto:robots@jpsc.co.uk]
Sent: Wednesday, May 05, 1999 10:13 AM
To: Ralph Hempel
Subject: Re: New pbFORTH
> > I've figured out how POWER_GET works, but not the return values. From the
> > docs it takes one argument, but the code says two ( addr-a code -- )
> >
> > HEX RCX_POWER 4000 POWER_GET RCX_POWER @ DECIMAL .
> >
> > seems to return 2 if the button isn't pressed, and 0 if it is.
>
> That is correct if you look at Kekoas description on his internals page,
> although he says the return value is one for not pressed,
Definately 2
> > Do you know the mapping of the raw battery voltage values? I seem to get
> > 280 (decimal) for NiCds
>
> Again, see Kekoa's page...the reference is on my home page.
I couldn't see it earlier, but I see now that the voltage in millivolts is
rawvoltage * 0xABD4 / 0x618
or 280 * 0.0282 gives 7.9v for my fully charged NiCds
> > I think it would be batter to have two calls
> > get_on_off_key_state ( -- state )
> > get_battery_voltage ( -- millivolts )
> > and do whatever needs to be done to return a flag for the first and true
> > voltage for the second.
>
> You are probably right here. I did what I did so you could query once and
> then just look at the variable. It's easy to hide the RCX_POWER function in
> your prototypes.
Of course - I'm just putting up flags here for future words to turn pbFORTH
into a polished system
> > POWER_OFF doesn't seem to work for me. I've tried:
> >
> > RCX_INIT
> > POWER_INIT
> > BUTTON_INIT
> > SENSOR_INIT
> >
> > then:
> >
> > POWER_OFF
> >
> > just causes the RCX to die and the ON/OFF button doesn't get it back.
>
> Yes, there IS still a bug, I'll dig it up shortly.
Oh, good - it's not just me then
> > I've tried HAT and BUILD and SLEEP, etc and so far it seems to work.
>
> Neat, huh? But what on earth does HAT mean? Something A Task ?
Here A Task? Something Japanese?
> Have you tried MARKER, it is a really useful word.
Ah, I thought that one was broken...
--
John Cooper, Wallington, UK
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|