|
I use Debian Jessie on an OPi-PC. I do : $modprobe sunxi_ir_rx
I have this cheap remote control (included with dvb-stick).
When I press the remote-keys I get characters in my terminal window.
(can somebody confirm that this works out of the box?)
I wrote a small program which makes use of this tremendous capacity! (no need for lirc! nor configuration! nor reading manual stuff!)
I did connect an LED to port PA_6 (pin number 7)
you can compile and test this with : gcc -o remote-led remote-led.c -lwiringPi
you need to change 'u' and '6' to your own remote output characters
----save as remote-led.c-----and remember-----I'm not a programmer----------
#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
//The WiringPi pin numbers used by our LEDs
#define LED3 6
#define ON 1
#define OFF 0
main()
{
if (wiringPiSetup () == -1)
exit (1) ;
pinMode (LED3, OUTPUT);
char ch;
system("stty raw");//seting the terminal in raw mode - if not you need CR
while(1)
{
ch=getchar();
// 6 is OFF ---- u in ON --- remotecontrol output in terminalwindow
if(ch=='u') digitalWrite(LED3, ON);
if(ch=='6') digitalWrite(LED3, OFF);
if(ch=='q'){ //terminate or come out of raw mode on "q" pressed
system("stty cooked");
exit(0); //or terminate
}
// printf("you pressed %c\n ",ch); //write rest code here
}
}
|
|