OLED 0.96 I2C 128x64 (SSD1306) [D003]



https://www.youtube.com/watch?v=GEWRMnRhHhE


* GitHubhttps://github.com/rdiot/rdiot-d003.git


* Specs

0.96" Inch Yellow and Blue I2C IIC OLED LCD Module Serial 128X64 LED Display for Arduino 51 MSP420 STIM32 SCR lcd display

Support wide voltage: 3.3V-5V DC

Driver IC: SSD1306

Communication: IIC, only two I / O ports

Viewing angle: greater than 160 degrees

Size: 0.96


* Contents

- Library : https://bintray.com/olikraus/u8glib/Arduino

- Library Desc : http://code.google.com/p/u8glib/wiki/u8glib


- Key Code

#include "U8glib.h"


U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);


void loop(void) {

  // picture loop

  u8g.firstPage();  

  do {

    draw();

  } while( u8g.nextPage() );


  // rebuild the picture after some delay

  delay(500);

}


void draw(void) {

  u8g.setFont(u8g_font_9x15B);

  u8g.setPrintPos(0, 12); 

  u8g.println("HC-SR04");


  u8g.setFont(u8g_font_helvB14);

  u8g.setPrintPos(0,40);


  int var = 0;

  u8g.print("Dist.="+(String)var+"mm");

}

Posted by RDIoT
|