Skip to content

Instantly share code, notes, and snippets.

@tedder
Created December 1, 2017 02:12
Show Gist options
  • Save tedder/57ddc04f1c6806f191101552fe87dd18 to your computer and use it in GitHub Desktop.
Save tedder/57ddc04f1c6806f191101552fe87dd18 to your computer and use it in GitHub Desktop.
arduino ssd1306 tests
#include "Wire.h"
#include "ssd1306.h"
#include "i2c/ssd1306_i2c_wire.h"
int c = 0;
#define SPEED 100000
void setup()
{
Serial.begin(115200);
gpio_pullup_en(cc->sda_io_num);
gpio_pullup_en(cc->scl_io_num); */
Wire.begin();
Wire.setClock( SPEED );
ssd1306_i2cInit_Wire(0);
ssd1306_128x32_init();
ssd1306_fillScreen(0x00);
ssd1306_charF6x8(0, 0, "Line01. text");
ssd1306_charF6x8(8, 1, "Line two");
}
void loop()
{
Serial.print("hey, our speed: ");
Serial.println(String(SPEED).c_str());
ssd1306_clearScreen();
ssd1306_fillScreen(0x00);
ssd1306_charF6x8(8, 0, "three");
ssd1306_charF6x8(0, 2, "four");
ssd1306_charF6x8(120, 3, String(c++).c_str(), STYLE_NORMAL);
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment