Subject:
|
Re: Sending ir packets
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Sat, 29 Sep 2001 23:43:31 GMT
|
Viewed:
|
1945 times
|
| |
| |
In lugnet.robotics.rcx, Trevyn Watson writes:
> I am writing a program, and it doesnt work. Right now im just trying to
> make sure I can interface with the serial port properly. So I am sending:
>
> 55 ff 00 51 ae 03 fc 54 ab
>
> At 2400 baud, 8 data bits, odd parity, and one stop bit.
>
> It doesnt work. The light on the ir tower turns on, but the rcx does
> nothing.
>
> When i run "nqc -raw 5103" it works just fine, so its not the rcx or the
> tower.
>
> So, my questions are:
> 1. Is that packet malformed?
> 2. How does one calculate the checksum?
>
> Thanks,
> Trevyn.
Here ya go:
Remember start bit (sometimes called 2 stop bit mode)
55 00 D1 ~D1...Dn ~Dn C ~C
Add all the normal D parts in a single Byte for Chksum.
Code chunk for example
...
unsigned char MuxStr[] ={0x55,0xf7,0x08,0x01,0xfe,0xf8,0x07};
count = 7;
MuxStr[3] = value;
MuxStr[4] = ~MuxStr[3];
MuxStr[5] = MuxStr[1]+MuxStr[3];
MuxStr[6] = ~MuxStr[5];
err = FSWrite(refNum, &count, &MuxStr);
....
Sends a Message of Value.
Best
DaveG
|
|
Message is in Reply To:
| | Sending ir packets
|
| I am writing a program, and it doesnt work. Right now im just trying to make sure I can interface with the serial port properly. So I am sending: 55 ff 00 51 ae 03 fc 54 ab At 2400 baud, 8 data bits, odd parity, and one stop bit. It doesnt work. The (...) (23 years ago, 20-Sep-01, to lugnet.robotics.rcx)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|