Welcome, Guest
Username: Password: Remember me

TOPIC: Arduino MEGA - U8glib Libraries Installation.

Arduino MEGA - U8glib Libraries Installation. 1 year 2 months ago #1232

  • Ray
  • Ray's Avatar
  • NOW ONLINE
  • Moderator
  • Posts: 599
  • Thank you received: 137
  • Karma: 37
pedalSHIELD MEGA uses a 1.3 inches (0.96 are also compatible) 4 pins OLED display, with I2C communication.

In order to use it and be able to compile the effects, you would need to install the U8glib Libraries, there are other methods, but this is the easiest one:

1. Open Arduino IDE and click on Sketch\Include Library\Manage Libraries...

libraries1.jpg



2. In the search box type U8Glib , scrolling down you will find it, click on More info and install the latest version (I am using 1.19.1)


libraries2.jpg



Once you have installed it, when you click again on Sketch\Include Library you will see the U8glib on the main list.


3. You can verify that all is correct loading this "Hello World" sample code:
#include "U8glib.h"
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK);  // Display which does not send ACK
 
void setup() {  
  u8g.setFont(u8g_font_unifont);
  u8g.setColorIndex(1); 
}
 
void loop() {  
  u8g.firstPage();
  do  {  
        draw();
      } while( u8g.nextPage() );
  delay(1000);   
}
void draw()
{
  u8g.drawStr( 0, 20, "Hello World");
}
Last Edit: 10 months 1 week ago by Ray.
The administrator has disabled public write access.
Time to create page: 0.124 seconds
Powered by Kunena Forum
Joomla SEF URLs by Artio