Skip to content

Just For the Record – the OLED

October 12, 2018

18-10-12 oled
This is based on code from: compied with
gcc pipetext.c ssd1306_i2c.c -lwiringPi -o pipetext
and tested with
echo “Hello World!” | ./pipetext

to use it with Hercules I’ll attach it to a printer as I did with the led pipe.

I’ll use it to pipe output from a hercules printer to the display – i’m imagining something that will echo the stepname and completion code for the last job run.

Pipe text to the ssd1306 i2c driver for  Raspberry Pi

#include "ssd1306_i2c.h"

void main() {
        printf("printer pipe to ssd1306\n");

        ssd1306_begin(SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS);

        ssd1306_display(); //Adafruit logo is visible

        char line[200];
        char ss[200];
        fgets(line, 200, stdin);
        printf("%d: %2x %2x %2x\n",strlen(line),line[0],line[1],line[2]);
        //char* text = "Hello World!";

From → Olduino/370

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: