To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 22351
22350  |  22352
Subject: 
Re: RCX to Spy messages thru IR communications route
Newsgroups: 
lugnet.robotics.spybotics, lugnet.robotics, lugnet.robotics.rcx, lugnet.robotics.rcx.nqc
Date: 
Thu, 25 Mar 2004 18:02:42 GMT
Viewed: 
263 times
  
In lugnet.robotics.spybotics, Jay Francis wrote:
In lugnet.robotics.spybotics, John Hansen wrote:
SetSerialData(0,0x80); // sometimes this is 0x81.  I don't know why

I think the low nibble of the first byte contains the Link ID of the Spybot.  It
is zero if the Spybot is not linked to a controller.  1 if it is linked to
controller 1, 2 if controller 2, etc.  This should be easy to double check with
your IR monitor setup.

Yes, that is what another person told me via email yesterday.  So a ping
simulation function for an RCX running the RCX2 firmware could be:

// nLinkID = 0-7, where 0 = no link, 7 = pc link, 1-6 = controller link
// nMyID = 8-255 (minBotID = 8, maxBotID = 255)
// nInfo = 0-255

__nolist void SendSpyPing(const int &nLinkID, const int &nMyID,
  const int &nInfo)
{
  SetSerialComm(SERIAL_COMM_4800|SERIAL_COMM_76KHZ);
  SetSerialPacket(SERIAL_PACKET_DEFAULT);
  int tmp = 0x80+(nLinkID&0x7);
  SetSerialData(0,tmp);
  SetSerialData(1,nMyID);
  SetSerialData(2,nInfo);
  SetSerialData(3,0x100-((tmp+nMyID+nInfo)&0xff));
  SendSerial(0,4);
}

I understand a little better now what these constants in Spybot.h mean:

const cNoID = 0
const cControllerID1 = 1
const cControllerID2 = 2
const cControllerID3 = 3
const cControllerID4 = 4
const cControllerID5 = 5
const cControllerID6 = 6
const cPCID = 7
const cMinBotID = 8
const cMaxBotID = 255

John Hansen
http://bricxcc.sourceforge.net/



Message has 1 Reply:
  Re: RCX to Spy messages thru IR communications route
 
I'm a little surprised that the Spybot doesn't need to see the packet header byte - the byte containing the range/orientation bits preceding the 0x8n Ping byte. The header is deliberately generated with the stop bit cleared to force a framing error. (...) (21 years ago, 25-Mar-04, to lugnet.robotics.spybotics, lugnet.robotics, lugnet.robotics.rcx, lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: RCX to Spy messages thru IR communications route
 
(...) Hi John, I think the low nibble of the first byte contains the Link ID of the Spybot. It is zero if the Spybot is not linked to a controller. 1 if it is linked to controller 1, 2 if controller 2, etc. This should be easy to double check with (...) (21 years ago, 25-Mar-04, to lugnet.robotics.spybotics)

10 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