Skip to content

Microbit-Grove-Library/pxt-OledDisplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grove - Oled Display

This is Makecode Grove - Oled Display(SH1107) package for micro:bit.

image

Usage

Connect

Simply connect Grove - Oled Display(SH1107) to the I2C port of Grove shiled, as the picture shown.

Demo 1: Display numbers and strings

Let's start with a very simple program:

  • In this program, the second line set oled to Create Oled Display means we will create an object to use Oled Display, this step is important and nessary.

  • Line oled Clear display means the display will be clear. This step is recommanded at the begin of a program.

  • Line oled Set display position at row 0 and column 0 is very useful. We can use this before Display string or Dispaly integer number, to set our display position. Note that there are 16 row and 128 column in Grove Oled Display, and row 0, column 0 is at the upper left corner.

    image

  • Line oled Display string "Hello!" is to display a string "Hello!"

Try to download the program to your Microbit! Then you will find "Hello!" on the display. Now let's try a big program like this, and guess what will happen:

image

Demo 2: Draw lines and rectangle

Let's draw 2 lines first:

image

  • oled Draw horizontal line start at x 0 and y 0, length 128 means draw a horizontal line. Please check the second picture of Demo 1, it also indicates the XY axis.

And draw a rectange by giving 2 XY coordinates.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published