This little blog shows you how to connect a 0.96" OLed to the Raspberry and programming with C#.
First of all we need the right OLed with the I2C interface, in my case i used a 0,96 Inch Oled for ~3€ in Ebay like this. It is controlled by a SSD1306 controller the hardware documentation can be found here: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
Now we connect the OLed to the Raspberry as follow:
Install Mono and WiringPi
see this links to install WiringPi and Monohttp://wiringpi.com/download-and-install/
https://www.mono-project.com/download/stable/#download-lin-raspbian
After installed, check the follow:
Mono
WiringPi
Setup I2C on the Raspberry
Enable I2C run: sudo raspi-config
Now close and reboot
After this the I2C module is available, please chek it with lsmod:
The code
My C# code is a small example and paints a rectangle and elipse on the 0.96 Inch Display with 128x64 Pixel. I use WiringPi function as an DllImport to communicate
You can download or clone the Visual Studio 2017 Project from here:
https://github.com/maza70/Oled_SSD1306
Keine Kommentare:
Kommentar veröffentlichen