Daft Question #2 :) - Running C code
Matt Ogborne last edited by
C is far from my prefered language of choice, however have had to learn it for the amount of IoT devices I've built with Arduino's, but... I've come to kinda like it, even with is strictness (personally I prefer sloppy PHP )
Anyway, that daft question...
I saw this guide http://log.liminastudio.com/writing/tutorials/tutorial-how-to-use-your-raspberry-pi-like-an-arduino earlier today on running C code on a Pi, is this portable to running on the Omega?
If so how would I go about the following:
#1 Checking on GPIO pins
#2 Posting updates via MQQT
So two bonus questions there And yes those might be daft ones, but I'm curious!
It;s the possibility of saving me from rewriting a shed load of code so I can deploy on Onion Omega's, which can be readily accessed and updated remotely (so no laptop and long extension lead and trying to press the RST and GPIO0 buttons on esp8266's anymore )
Kit Bishop last edited by
@Matt-Ogborne I can provide some pointers to C access to the GPIO pins.
Or rather in C++ (not significantly more complex than using C)
There is some official code (fast-gpio) in https://github.com/OnionIoT/fast-gpio specifically https://github.com/OnionIoT/fast-gpio/blob/master/src/fastgpio.cpp
Additionally, I have produced and published some C++ code for GPIO access that significantly expands on the functionality that is provided by fast-gpio including the capability of handling interrupts. This code (new-gpio), including documentation can be found at https://github.com/KitBishop/new-gpio
This code is currently being improved further and updates will be published as they become available.
As an aside, there is also associated Java wrapper code for this that can be found at https://github.com/KitBishop/java-gpio in case you are interested.