To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 247
246  |  248
Subject: 
Re: IR Sensitivity - Was: 1.5/2.0 infrared problem
Newsgroups: 
lugnet.robotics.rcx, lugnet.robotics.rcx.legos, lugnet.robotics.spybotics
Date: 
Mon, 3 Nov 2003 22:54:28 GMT
Viewed: 
673 times
  
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:
  Re: IR Sensitivity - Was: 1.5/2.0 infrared problem
 
(...) Thanks a lot for posting this very useful information, Mark! I don't know how long I've been beating my head against the brick trying to make heads or tails out of the values I calculated for the various possible combinations of button (...) (21 years ago, 4-Nov-03, to lugnet.robotics.rcx, lugnet.robotics.rcx.legos, lugnet.robotics.spybotics)
  Re: IR Sensitivity - Was: 1.5/2.0 infrared problem
 
(...) ... (...) ... (...) Yes. The extra channels are for non-repeating stuff. Like you said. (...) Well, I've discovered (while working on a Spybot project) that if you ask just the right question, the people at LEGO may reply to it. They are (...) (21 years ago, 4-Nov-03, to lugnet.robotics.rcx, lugnet.robotics.rcx.legos, lugnet.robotics.spybotics)

Message is in Reply To:
  Re: IR Sensitivity - Was: 1.5/2.0 infrared problem
 
(...) 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. :) Steve (21 years ago, 3-Nov-03, to lugnet.robotics.rcx, lugnet.robotics.rcx.legos, lugnet.robotics.spybotics)

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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR