Use of the OLED display ad I2C. Includes the use of Arduino libraries.

The Grove Beginner Kit For Arduino includes an Arduino Uno board with preconnected devices. The Grove lessons supporting this present coding using the Arduino IDE. These pages present the same lessons using the Codecraft IDE that uses the Block style of coding with specific Grove Arduino blocks.

OLED Display can be used for many situations, where you could use it to visualize sensor readings!

Background Information:

  • What is Arduino Libraries

The Arduino environment can be extended through the use of libraries, just like most other programming platforms. Libraries provide extra functionalities for use in sketches, i.e. working with specific hardware or manipulating data. To use a library in a sketch, select it from Sketch ->Include Library.

This lab implicitly uses the U8g2 Arduino library. Whereas in the Arduino IDE you have specify it, CodeCraft loads it for you here.

Grove Beginners Kits Components

Lesson7

                Component                   Interface                   Pins/Address                  
LED Digital D4
Buzzer Digital D5
==OLED Display 0.96”== ==I2C== ==I2C, 0x78(default)==
Button Digital D6
Rotary Potentiometer Analog A0
Light Analog A6
Sound Analog A2
Temperature & Humidity Sensor Digital D3
Air Pressure Sensor I2C I2C, 0x77(default) / 0x76(optional)
3-Axis Accelerator I2C I2C, 0x19(default)

Components used for this lesson are highlighted.

  • Components Involved

    1. Grove Beginner Kit
    2. Grove OLED Display 0.96

2. Implement the code block.

Lesson7

Comment: Compared to the same lesson when writing actual code this lab is quite trivial. When done have a look at the code behind. Look for <\> button at the top and toggle that. Note also that the Clear Display in setup is required.

How to create this …

Watch the video on Youtube:

3. Run the app

Download the app to the board, as in previous lesson

Outcome:

Prints Hello World onto the OLED Display.


About Arduino Libraries

This lab implicitly uses the U8g2 Arduino library. Whereas in the Arduino IDE you have specify it, CodeCraft loads it for you when building the app prior to send it.

There is no capability in CodeCraft to explicitly include an Arduino library. You can only use teh ones that are boudn up in the components supplied.

If you want to more information about U8g2 library, please refer to here.

For more information about Arduino libraries, please also visit How to install Arduino Libraries.


 TopicSubtopic
   
 This Category Links 
Category:Grove Arduino Index:Grove Arduino
  Next: > Grove Beginner Kit For Arduino
<  Prev:   Grove Beginner Kit For Arduino