lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Numbers

moo06 opened this issue · comments

commented

Hi,
Is there any way I could print a variable onto the OLED?

Thanks

Hi,

what type of variable you're trying to print?

commented

Hi,
It is an analogRead() because I'm debugging the button values so I can make a tech demo. Since I'm using an ATTINY85, and I'm using practically all the pins, I can only try and show it on the screen.

Thanks

Hi here is an example for printing numbers:

#include "ssd1306.h"
#include <stdio.h>

void printNumber(int x, int y, int number)
{
    char intStr[12];
    snprintf(intStr, sizeof(intStr), "%i", number );
    ssd1306_printFixed (x, y, intStr, STYLE_NORMAL);
}

Dup of #96

Did the example above help you?

commented

Hi, yes thank you.