Adafruit Pi Zero OLED

The Adafruit Pi OLED fits on top of the Raspberry Pi Zero W and uses I2C pins, not GPIO pins, which is really excellent

Just plug it in and go to the Adafruit web site and look up “Usage” and follow the steps to ensure it works

In a few days I will have this cute little Adafruit Pi OLED, and will be able to write to it almost as easy as printing a line using printf in C. To prepare, I have added a couple print statements for the L and C sections of the stepper motor control code. Here is what it looks like:

The code knows which stepper motor you are switched to, and I just print the encoders position. I keep the last position it was at if you switch – so it ends up being exactly like if you were tuning the knobs and recording the positions when tuning the front controls manually. This will come in handy in future releases of the u.RAT, when I add in memory support and where you could assign a KPOD button to a memory location.

Adafruit has complete specs and instructions for the Pi OLED:

https://learn.adafruit.com/adafruit-pioled-128×32-mini-oled-for-raspberry-pi/overview

In fact, they have the schematic and even the Fritzing files for this device. I can’t begin to tell you how much I am learning and how fast. Since we live in a day where electronic circuits are SMD based boards, we have gone from the days where you needed to know about each discreet device (like when I soldered Heathkit HW-7 and HW-8 or Elecraft K1 and pre-Elecraft SSD kits), to a day where all you need to know is what you want your project to do and then understand your circuit by block diagram, in most cases, each circuit board is a block in your block diagram. be

In the Raspberry Pi and Arduino world – you source boards that use resources, plan to use them properly, plug them in and then learn a few C or Python commands from a library that you can download from Github. The most complex electronics have now been democratized so anyone can invent using commodity components. Its not evolutionary, its revolutionary.

It also encourages people of all walks of life to learn about electronics and coding. Ham Radio surely is joining these wonderful ranks, in fact, I see a future where Makers become hams and vice versa. Win win.

I need to find a C library out there for this little Pi OLED – I did a quick Google search and found a few, but I need to research to find the best one that fits this project.

I at least have my code ready – with printf statements in the right place and where all I will need to do is replace the printf with whatever puts the text on the OLED. Here is the Adafruit Library:

https://github.com/adafruit/Adafruit_SSD1306

But it seems to have so much more junk in it than I need – like drawing lines and stuff. I just need “hello world” level stuff – just character / text.

Here is one library – just text – which is what I need:

https://github.com/McNeight/LiquidCrystal_SSD1306

And the code to print is exactly what I had hoped for:

// include the library code:
#include <TinyWireM.h>
#include <LiquidCrystal_SSD1306.h>

// initialize the library with the numbers of the interface pins
#define OLED_RESET 4
LiquidCrystal_SSD1306 lcd(SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS, OLED_RESET);

void setup() {
 // set up the LCD's number of columns and rows:
 lcd.begin(21, 7);
 // Print a message to the LCD.
 lcd.print("hello, world!");
}

void loop() {
 // set the cursor to column 0, line 1
 // (note: line 1 is the second row, since counting begins with 0):
 lcd.setCursor(0, 1);
 // print the number of seconds since reset:
 lcd.print(millis() / 1000);
}