U8g2 con font custom su SSD1306 — Arduino Uno simulation

Sketch Arduino Uno + SSD1306 128x64 I2C con libreria U8g2 e slot pronto per un font personalizzato.

An interactive Arduino Uno circuit simulation you can run free in your browser on Velxio, by anto2k1.

Components

Sketch code

// Arduino Uno - DHT22 + OLED SSD1306 con U8g2 (page buffer)
// Wiring DHT22: VCC->5V, GND->GND, SDA->D2 (pull-up 10k tra VCC e SDA)
// Wiring OLED : VCC->5V, GND->GND, SDA->A4, SCL->A5
//
// Librerie richieste (non pre-installate, vanno aggiunte):
//   - U8g2 (olikraus)
//   - DHT sensor library (Adafruit)
//   - Adafruit Unified Sensor

#include <Wire.h>
#include <U8g2lib.h>
#include <DHT.h>

  /*
  Fontname: SevenSeg
  Copyright: Created with Fony 1.4.7
  Glyphs: 140/256
  BBX Build Mode: 0

  bdfconv.exe -f 1 -m '46-57' -n SevenSeg -o SevenSeg.c SevenSeg.bdf
*/

const uint8_t sevenseg[1139] U8G2_FONT_SECTION("sevenseg") = 
  "\20\0\4\4\5\5\5\6\6\21\35\1\353\10\0\0\0\0\0\0\0\2X%D\221GF\216\222B\206"
  "\4#%\254\220(C\242F\10\22DBT\30\42AF\21*Cz\64a\322\244G\23&=\232\60"
  "i\42\245\10\15\11C$\224\20\62\202\204\14\222\202\220\24\243D\225\12\62(`\11\0-\15\256\310K"
  "\26\65,\134\260Q\2\0.\13\307TF\216\22\17Z\224\0\60)\261\307E\216\67M\202,\31\222\244"
  "\310\225xy\266\364x\0\341a%\234\260Q\224xy\344H\221$C\226\4i\363\2\0\61\31h\353"
  "F\206\23Fj\62\210^\15\23\27\36`\60Q\203\350\253a\342\2\62.\261\307E\216\67M\202,\31"
  "\222\244\310\225(I\323|<\0\61j\202\60r\304&\210\42\361\0\206\223\246\353!\247\204$\12\262\252"
  "\315\13\0\63/\261\307E\216\67M\202,\31\222\244\310\225(I\323|<\0\61j\202\60r\304$\214"
  "\22\341\243i\215\22\345\221#E\222\14Y\22\244\315\13\0\64\42\61\307F\206\360\0F\227=\211\227g"
  "K\17Q\23\204\221#&a\224\10\37M\237\217\7 \36D\0\65.\261\307E\216\67M\202\254\21\222"
  "h\310)\322t=\134<\200 \312\30\71b\22F\211\360\321\264F\211\362\310\221\42I\206,\11\322\346"
  "\5\0\66-\261\307E\216\67M\202\254\21\222h\310)\322t=\134<\200 \312\30\71b\42D\11a"
  "\243(\361\362\310\221\42I\206,\11\322\346\5\0\67 p\313F\206'\215\226\204I\42\350\310`z="
  "\134<\200\360\60\11.z\60}=\134<\200\0\70,\261\307E\216\67M\202,\31\222\244\310\225xy"
  "\266\364\20\65A\30\71b\42D\11a\243(\361\362\310\221\42I\206,\11\322\346\5\0\71-\261\307E"
  "\216\67M\202,\31\222\244\310\225xy\266\364\20\65A\30\71b\22F\211\360\321\264F\211\362\310\221\42"
  "I\206,\11\322\346\5\0C&\260\307E\216'-\202,\21\222f\310!\302t<Zxx\270\11\17"
  "@\370h\302t<\344\220\220\64A\26\65yH#\61\307F\206\360\0F\227=\211\227gK\17Q\23"
  "\204\221#&B\224\20\66\212\22/\317\226\36\17 \0\260\34\61\306K\216\67M\202,\31\222\244\310\225"
  "xy\266\364\20\65A\30\71b\246\10\0\0\0\0\4\377\377\0"; 
  /* = 
  "\17\0\4\4\5\5\5\6\6\21\35\1\353\10\0\0\0\0\0\0\0\2M%D\221GF\216\222B\206"
  "\4#%\254\220(C\242F\10\22DBT\30\42AF\21*Cz\64a\322\244G\23&=\232\60"
  "i\42\245\10\15\11C$\224\20\62\202\204\14\222\202\220\24\243D\225\12\62(`\11\0-\15\256\310K"
  "\26\65,\134\260Q\2\0\60)\261\307E\216\67M\202,\31\222\244\310\225xy\266\364x\0\341a%"
  "\234\260Q\224xy\344H\221$C\226\4i\363\2\0\61\31h\353F\206\23Fj\62\210^\15\23\27"
  "\36`\60Q\203\350\253a\342\2\62.\261\307E\216\67M\202,\31\222\244\310\225(I\323|<\0\61"
  "j\202\60r\304&\210\42\361\0\206\223\246\353!\247\204$\12\262\252\315\13\0\63/\261\307E\216\67M

More projects by anto2k1