DisplayOTronHat C interface


Before I start writing one and reverse engineering the python code, does anyone know of a C interface for the Display O Tron Hat?

It would be particularly cool if it used the underlying WiringPi libraries as I’m using those in other parts of the project I’m doing.



look at the arduino libs for the sn3218 in the Pimoroni github repo as it might help you with the LEDdriver part: https://github.com/pimoroni/pimoroni_arduino_sn3218

the st7036 also has a few arduino libs out there you could peek at. It’s not C per se, but it will be some way towards what you want to achieve, I guess… as far as I know porting that kind of stuff to the Pi was one of the goal of WiringPi?


see here :

This is my kernel module and you have an example in C ;)
You can control the display o tron hat with the language you want with sysfs.
See the ioclient.c in the source it use the touch mapping , the LCD to draw the bandwith of a tun0 interface in real time with clock. When you touch a sensor it will draw a sweep rainbow with LCD.
All you need is to write and read to a file with a fopen, fprintf, ffscanf . Very very easy to use.
You can help me to produce a lib C that use the sysfs or wait i’ll currently produce one.
So your help is welcome ;)


Yes, I found your kernel module shortly after posting the question last night. It looks good and exactly what I was looking for really - i.e. the underlying work of dealing with the SPI/I2C interfaces is done properly in the kernel and I now only have to look at writing the shims to provide reasonable high level access for C.

The only comment I have is about the RPi ecosystem - compiling a kernel module requires the kernel sources and finding those for the standard Raspbian kernel was not entirely straightforward. I sort of know what I’m doing and it took me about an hour to find everything and get it all sorted - I hate to think how a novice would cope with it!


I’m agree with you about the kernel source.
But someone has make a great jobs here :

Just do a rpi-source and make and you module is compiled