|
10 months ago | |
---|---|---|
bin | 10 months ago | |
src | 10 months ago | |
.clang-format | 11 months ago | |
.gitignore | 11 months ago | |
LICENSE.md | 11 months ago | |
Makefile | 11 months ago | |
README.md | 10 months ago |
Utility to receive OSC messages to control rasperry pi's GPIO pins. Usage:
gpiosc [port] [address]
address is optional and it will default on reacting to incoming message on /gpio
.
Received OSC messages should have two int argument: the first is the GPIO number to address (any number from 1 to 27 is valid) and the second is the value to set (any value greater than 0 will be treated as HIGH, the others as LOW). As soon as a message for a pin is received the first time, that pin mode is set to OUTPUT.
To quit the program you can use SIGINT by pressing CTRL+C or sending a SIGTERM with another console with killall gpiosc
.
you need liblo
installed (included dev packages) in your system, then you build with make, for example on raspbian you could get everything you need like this
sudo apt-get install build-essential
sudo apt-get install liblo7 liblo-dev
git clone https://git.sr.ht/~npisanti/gpiosc
cd gpiosc
make
then you will have an executable in bin/gpiosc
.
To build in debug mode, you should make clean
first and then make debug
, the output executable will have the same name.
This is directly writing at the BCM2835 memory address, and it's tested just by using all the pins as digital I/O, i'm not responsible of any damage this program could do to any device connected to the GPIO that needs to be treated differently, for example LCD displays.
This lecture and some of this code.
Nicola Pisanti, MIT License 2020