Please read the document carefully from Lab 2.
Now we want to use I2C LCD.
We can write a code to comunicate with the LCD with Bare I2C protocol. However it is time consuming. Therefore, We will use Oled library.
Please follow this link and install Oled library
Connect the Oled Display using our last schematic: **(please connect only Arduino and Oled and needed wires) **
Is it okay? Let's go...
Ex.1 | REMOVED |
---|
Ex.1 | see this link and find the connected I2C Devices |
---|
Ex.2 | Please open Example by: File -> Examples -> adafruit SH1106->I2C, see the result and describe shortly the functionality of following functions in home! (HINT) |
---|
display.display();
display.draw_string(4,2,"Hello");
display.draw_string(4,2,"Hello",OLED::DOUBLE_SIZE);
display.draw_string_P(16,15,PSTR("World!"),OLED::DOUBLE_SIZE);
display.draw_bitmap_P(0,0,128,64,bitmap);
display.set_invert(true);
display.set_contrast(value);
//optional
display.draw_line(16,31,88,15);
display.draw_pixel(127,0);
display.draw_circle(36,16,14,OLED::SOLID);
display.draw_rectangle(64,0,98,31);
As you can see in the last example we use Efrei photo. Now we want to use our own image!!!
when you see line 7 of oledtest.ino, you can see the image bytes. To build your own one :
- upload you image here,
- specify the
width
andheight
(less than 128 x 64), - choose proper
threshold
(between 0 and 255) - select
scale to fit, keeping proportions
option. - click on
generate code
. - Use the generated content instead of the old one
- don't forget to specify the
width
andheight
used in the second item here:display.draw_bitmap_P(0,0, width,height,bitmap);
Ex.3 | Display your team name on the Oled with big font and add a random logo (Search for a single color logo or build you own logo and display it in the screen.) |
---|