To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3385
3384  |  3386
Subject: 
Re: LEGO remote controller problem
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 28 Jul 2003 14:05:09 GMT
Viewed: 
2941 times
  
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...
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;
}



Message is in Reply To:
  Re: LEGO remote controller problem
 
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); (...) (21 years ago, 28-Jul-03, to lugnet.robotics.rcx.legos)

11 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR