SDASCL16 × 2 CHARACTER LCDHD44780RSED7D6D5D40101010101page 0page 1OLED · TOP-LEFT 16 × 16 DOTS01SSD1306UNOATmega328Pbuffer 1,024 B1lcd.setCursor(0, 0);2lcd.print('A');3oled.setCursor(0, 0);4oled.print('A');5oled.display();'A' = 0x41bits = 0100 0001cols = 7C 12 11 12 7C10000000010000010x41'A'0x3C0x407C1211127C
Back: the two screens and their controller chipsMiddle: the LCD's six bus lamps and the two I2C wires; front: the Uno, the sketch and the byte 'A'Tokens: half-bytes, the address and control byte, and the OLED's column bytesA 16 × 2 character LCD with its HD44780 controller and a 128 × 64 OLED with its SSD1306 controller, both driven by an Arduino Uno R3. The LCD gets 'A' as one byte, 0x41, sent as two halves on RS, E and D7 to D4, and draws it from its own font ROM. The OLED has no font: the Uno draws A into a 1,024 byte frame buffer and sends it over I2C, one byte per column of 8 dots.

Two screens

  1. A character LCD shows text in fixed cells: 16 columns, 2 rows, each cell 5 by 8 dots. An OLED is a free grid of 128 by 64 dots, each giving off its own light. We will put the letter A on both.

Character LCD

OLED

Choosing

What happens

;; step 1/11 · two-screens
character LCD  16 x 2 cells, 5 x 8 dots each
               text only, in fixed places
OLED           128 x 64 dots, each its own light
               any shape, anywhere
goal           the letter A in the top-left corner of both

The card shows the five lines that put A on both screens. The whole sketch also creates lcd (pins 12, 11, 5, 4, 3, 2) and oled (128 x 64, I2C address 0x3C), calls lcd.begin(16, 2) and oled.begin(), clears the OLED and sets its text colour to white. The OLED in the figure shows only its top-left 16 x 16 dots (pages 0 and 1), enlarged; the real screen has 128 x 64. The A uses the Adafruit GFX built-in 5 x 7 font, so its eighth row is empty.