|
In lugnet.robotics.rcx, Steve Hassenplug wrote:
> In lugnet.robotics.rcx, Steve Hassenplug wrote:
> >
> > Thanks for posting this. I've been trying to figure out how to do that, but I
> > don't know enough about the IR messages and baud control of BrickOS to do it
> > myself.
You're welcome!
> > >
> > > // check for channel assignment packet
> > > // format: 100100CC 1111SSSS
> > > // C = channel number (1 to 3)
> > > // S = checksum
> > > if ( (spy_packet[0] & 0xFC) == 0x90 &&
> > > (spy_packet[1] & 0xF0) == 0xF0 )
> > > channel = spy_packet[0] & 0x03;
> > > }
> >
> > I don't know if this is printed anywhere, but here's some more info about the
> > Spybot remotes:
> >
> > "in addition to the channels 1, 2 and 3, there are
> > three more channels 4, 5 and 6 (which you select in Setup mode by holding
> > down the lower left buttion (SHIFT) when pressing the normal channel buttons"
>
>
> As cool as this sounds, it's not right. :( Sorry about that.
>
> There are just the two bits (like Mark said above).
>
> See, this is why I haven't been able to get my Spybot remote to work with my
> RCX. :)
Well, I did try it out and it does work... somewhat. For example, when you set
the channel to 5 using the technique mentioned above, only some of the remote
packets reflect 5 as the channel number, while others still indicate a channel
of 2. Unfortunately, in the main operating mode (mode lever flipped all the way
to the left) the channel # in the packets for the motor and fire* buttons is 2,
not 5. So this leaves us with only 3 channels for controlling the drive motors.
The buttons that send packets in the setup and ping modes *do* indicate channel
5, however.
I modified my program like this to take into account the possibility of getting
a channel assignment packet in the range 4 to 6:
// check for channel assignment packet
// format: 10010CCC 1111SSSS
// C = channel number (1 to 6)
// S = checksum
if ( (spy_packet[0] & 0xF8) == 0x90 &&
(spy_packet[1] & 0xF0) == 0xF0 )
{
channel = spy_packet[0] & 0x07;
if (channel > 3) channel -= 3; // reduce to 1-3 range
}
I'm curious, Steve, where did you get the information about channels 4-6?
(Thanks, BTW!) It always bothered me that the lower left button didn't appear
to do anything in setup mode.
So, here's a brief summary of the Spybot remote packets (AFAIK):
Operating Mode
01CCRRRR LLLLSSSS Motor drive buttons (repeats when buttons held down)
10010CCC 0010SSSS Fire button (once when button pressed)
00CC0001 0001SSSS Fire button (repeats when button held down)
Setup Mode
10010CCC 1111SSSS Channel assignment (lower right button)
Ping Mode
10010CCC 0000SSSS Ping (repeats continuously)
10010CCC 0001SSSS Upper left button (once when button pressed)
10010CCC 0010SSSS Fire button (once when button pressed)
10010CCC 0011SSSS Upper right button (once when button pressed)
10010CCC 0100SSSS Lower left button (once when button pressed)
10010CCC 0101SSSS Lower right button (once when button pressed)
Legend
CC = Channel number (1 to 3)
CCC = Channel number (1 to 6)
SSSS = Checksum (chosen so sum of all nibbles is zero)
RRRR = Right motor buttons
0000 - No button pressed
0111 - Foward pressed
1111 - Reverse pressed
LLLL = Left motor buttons
0000 - No button pressed
0111 - Foward pressed
1111 - Reverse pressed
Anyway, I can only imagine the chaos that would ensue if six people could each
control a train on the layout. Three people is more than enough for some
spectacular derailments - just ask my kids! :-)
Mark
* The first packet issued with the fire button in operating mode does indicate
channel 5. The following packets all are channel 2.
|
|
Message has 2 Replies:
Message is in Reply To:
17 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
|
|
|
|