I've managed to connect a IR sensor to GPIO pin 23 and get LIRC to work with one of my remote controls. I've also set irexec
up to launch a bash-script that drives motors (connected via open collectors):
#!/bin/bash
gpio -g mode 4 out
gpio -g mode 7 out
function forward {
gpio -g write 4 1
gpio -g write 7 1
}
function left {
gpio -g write 4 0
gpio -g write 7 1
}
function right {
gpio -g write 4 1
gpio -g write 7 0
}
function stop {
gpio -g write 4 0
gpio -g write 7 0
}
case $1 in
"forward")
forward
;;
"left")
left
;;
"right")
right
;;
"stop")
stop
;;
esac
Now, the problem is, after the first key press on the remote control, the motors start to spin but LIRC stops receiving any signals.
I assume writing to pins other than 23 causes the 23rd pin to be lost for lirc_rpi?
./motors.sh stop
directly, the IR is still not working. I tried reloading the kernel module, to no avail.mode2
reports silence.&
in the end.