Skip to content

Instantly share code, notes, and snippets.

@smcl
Created May 23, 2017 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smcl/3f1e4318d6a2520c74c1deaf455a3279 to your computer and use it in GitHub Desktop.
Save smcl/3f1e4318d6a2520c74c1deaf455a3279 to your computer and use it in GitHub Desktop.
quick demo of iso 8859-2 chars on arduino/ssd1306 using adafruit graphics library
#include <stdint.h>
#include <gfxfont.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
char msg[32] = { // can't be bothered counting
0x44, 0x6f, 0x62, 0x72, 0xfd, 0x20, 0x64, 0x65, 0x6e, 0x2c, 0x20, 0x6a, 0x61, 0x6b, 0x20, 0x73, 0x65, 0x20, 0x6d, 0xe1, 0xb9, 0x3f,
NULL
};
#define OLED_MOSI 9
#define OLED_CLK 10
#define OLED_DC 11
#define OLED_CS 12
#define OLED_RESET 13
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC);
}
void loop() {
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(1, 1);
display.print(msg);
display.display();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment