Subject:
|
Re: RIS 2.0 PreAlpha SDK
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Sun, 2 Apr 2000 23:50:24 GMT
|
Highlighted:
|
!
(details)
|
Viewed:
|
2660 times
|
| |
| |
In article <38E6DCFC.48024BEF@akasa.bc.ca>, Dean Husby
<nntp@akasa.bc.ca> wrote:
> Dave Baum wrote:
>
> > In article <38E68B07.BCDC2B85@akasa.bc.ca>, Dean Husby
> > <nntp@akasa.bc.ca> wrote:
> >
> > > Ralph Hempel wrote:
> > >
> > > > In case anyone hasn't noticed yet....
> > > >
> > > > <http://www.legomindstorms.com/sdk2/index.html>
> > >
> > >
> > > Thanks.
> > >
> > > I've noticed the Firmware File size is HUGE Almost 25K! Ouch...
> > >
> > > I've sent the following points already to the LEGO feedback. If any of
> > > you agree I strongly suggest you do the same. Power in numbers...
> > >
> > > "This is a comment on the implementation of the Firmware.
> > >
> > > First, the command PBBATTERY states that it is DIRECT only.
> >
> >
> > Check out page 7 of the LASM Byte Codes doc. They've added a lot more
> > data "sources" including one for the battery level. This means you'll
> > be able to use the battery level the same way you currently can read
> > Timers, the Watch, etc.
> >
> > Too bad its read-only, though. I was hoping to charge up my batteries
> > with software <g>
>
> Check out page 11. It states that it's DIRECT only. Not program.
I believe the PBBattery() command is very different from using the
Battery 'data source'. Specifically, the command is direct only (after
all, there's no equivalent within a program for the response data from a
command). However, data sources are valid in many places...perhaps the
most important being 'setv'.
Here's a little NQC program that will cause the battery level to be
moved to a variable and continuously displayed.
----
// set the display mode
void Display(const int &v, const int prec) { asm { 0xe5, 0, prec, &v :
0xffff}; }
task main()
{
int batt;
// setup display to continuously view the 'batt' variable
SelectDisplay(7);
Display(batt, 3);
while(true)
{
// the @ operator is used to de-reference a data source. The
// source type is bits 16-23 and the value is bits 0-15.
// Source #34 (0x22) is the battery level
batt = @0x220000;
}
}
----
You can probably use the battery level source directly in the display
setup opcode (0xe5), except NQC currently doesn't understand data
sources beyond the first 16 and will try to 'help' you by moving it into
a variable first.
Dave
--
reply to: dbaum at enteract dot com
|
|
Message is in Reply To:
| | Re: RIS 2.0 PreAlpha SDK
|
| (...) Check out page 11. It states that it's DIRECT only. Not program. That's what I gather anyway... Dean -- Coin-Op's For Sale!: (URL) Lego Workshop: (URL) Lego Club: (URL) (25 years ago, 2-Apr-00, to lugnet.robotics.rcx)
|
7 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|