|
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:
Message is in Reply To:
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
|
|
|
|