Subject:
|
Re: LEGO remote controller problem
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Mon, 28 Jul 2003 06:43:11 GMT
|
Viewed:
|
3141 times
|
| |
| |
Hi Michael,
Thank you very much for your answer.
Well, there isn't really much source, here we go:
#include <conio.h>
#include <unistd.h>
#include <remote.h>
#include <dsensor.h>
int my_lr_handler(unsigned int etype, unsigned int key) {
cputw(key);
return 1;
}
int main(int argc, char **argv) {
lr_startup();
lr_set_handler(my_lr_handler);
ds_active(&SENSOR_1);
while (!shutdown_requested()) {
lcd_digit(LIGHT_1 / 10);
msleep(200);
}
lr_shutdown();
ds_passive(&SENSOR_1);
return 0;
}
The main program just displays the reading of a light sensor on the right
digit, while the remote handler should display any received key value.
However, when I run this program and press some buttons on the RC, only the
IR indicator flickers.
As the remote control is working for you, I guess I am probably missing
something simple here.
Could you please point me to the right direction?
Regards,
Christian
> Hi Christian,
>
> > I have problems getting the LEGO IR remote controller to work (using brickOS
> > 0.2.6.10). I wrote a small test program [...]
>
> No program, no help. If you send me the sources, I will take a look and
> try to figure out the problem. In fact, I use the remote control without
> a problem.
>
> Regards,
>
> Michael
>
|
|
Message has 2 Replies: | | Re: LEGO remote controller problem
|
| (...) I compiled your program and it did everything. No problem on my side. If you don't start your program, does the remote control work? Attach a motor at A, B and C and try to run it with the remote. Or try to run your program with the P1 button. (...) (21 years ago, 28-Jul-03, to lugnet.robotics.rcx.legos)
| | | Re: LEGO remote controller problem
|
| Try removing the calls to lr_startup() & lr_shutdown(). I think these already get called outside of your program. (Sorry, don't have time to test right now). Mark "Christian Hornung" <c-hornung@gmx.de> wrote in message news:HIq2o2.Ht4@lugnet.com... (...) (21 years ago, 28-Jul-03, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
11 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
|
|
|
|