Subject:
|
NQC SendMessage to legOS successful!
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Tue, 28 Aug 2001 14:36:14 GMT
|
Viewed:
|
1623 times
|
| |
| |
I hacked legOS and make NQC sending standard firmware message to legOS, you
an see the test legOS and NQC program as below, NQC program send a random
message and display it, legOS program receives that message and display it.
But I can't implement legOS send message to NQC, I tried to use
lnp_logical_write(buf, 9);
here buf[]={0x55, 0xff, 0x00, 0xf7, 0x08, 0x01, 0xfe, 0xf8, 0x07} for
message 1, but no message is sent. Does anyone have suggestion?
Zhengrong
// msg.c
int main(int argc, char **argv)
{
unsigned char msg;
char t[10];
int x, y, z, i;
while (1) {
msg = lnp_message_read();
if (msg) {
x = msg / 100; y = (msg - x * 100) / 10;
z = msg - x * 100 - y * 10; i = 0;
if (x > 0) {
t[i] = x + 48; i++;
}
if (y > 0 || x > 0) {
t[i] = y + 48; i++;
}
t[i] = z + 48; i++; t[i] = 0;
cputs(t);
}
msleep(500);
}
return 0;
}
//msg.nqc
int msg;
int x = 0;
task main()
{
SetUserDisplay(x, 0);
while (true) {
msg = Random(254) + 1;
x = msg ;
SendMessage(msg);
Wait(500);
}
}
|
|
Message has 1 Reply:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|