Tag Archive: infrared

2016
03/14

Category:
Computing

TAG:


COMMENTS:
Comments Closed

Robot retro-fit update

I’m excited to go to the Coding Evening in Peterborough event tomorrow, but before I go I wanted to try something out that I was struck by when I was using my old PS2 remote control with my Pi (ahead of getting the motor wired up).

Although I’ve managed to “see” the old helicopter remote control signals, I decided that it was time I heeded my own device (like I keep saying to my 12yo-maker, “start simple, then gradually add complexity”) and so put the helicopter remote side in favour of a known device like the old PlayStation 2 remote control. Which turns out to have been very sensible advice.

I spent some time finally getting my head into the lirc libraries, configuration and sample code. It all worked nicely, but I wasn’t totally satisfied as it didn’t track the key down/up events that make for a smooth motoring experience (as demoed so nicely by the new GPIO Zero library recipes).

But as I tested, I noticed that the cursor was actually moving around the IDLE console output window, and it struck me that perhaps the lirc input could be read by the Python evdev library that I’ve been playing with in school recently…

And this evening I found that indeed it can! It appears that once the lirc configuration is set, the evdev library sees it as another input and from there all is good; I can now track key up, key down (and, should I need them, key held) events which means a smooth control for the all important 4yo soak testing, to come later.

Now I can really look forward to tomorrow evening ?