Skip to content

YFROBOT-TM/pxt-yfrobot-oled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YFROBOT OLED MakeCode Package

This is the MakeCode Package for YFROBOT OLED controller, based on the Adafruit Arduino library available here.

Blocks

Initialize YFROBOT OLED Display

Initializes the YFROBOT OLED display.

Sets up the YFROBOT OLED display and prepares it for use by the micro:bit.

YFOLED.init(64, 128);

This block must be placed before any of the show blocks.

Show String Without Newline

Displays a string on the OLED module without a newline.

YFOLED.showString1("hello, micro:bit!")

The init block must be placed before this.

Show String With Newline

Displays a string on the OLED module with a newline.

YFOLED.showString2("hello, micro:bit!")

The init block must be placed before this.

Show Number Without newline

Displays a number on the OLED module without a newline.

YFOLED.showNumber1(123)

The init block must be placed before this.

Show Number With Newline

Displays a number on the OLED module with a newline.

YFOLED.showNumber2(123)

The init block must be placed before this.

Clear Display

Clears the display.

YFOLED.clear()

The init block must be placed before this.

Draw Outlined Rectangle

Displays an outline of a rectangle.

YFOLED.drawRectangle(x,y,w,h)

The init block must be placed before this.

Draw Outlined Circle

Displays an outline of a circle.

YFOLED.drawCircle(x,y,r)

The init block must be placed before this.

Draw Line

Displays a line.

YFOLED.drawLine(x1,y1,x2,y2)

The init block must be placed before this.

Progress bar

Displays a progress bar with a specified percentage of progress.

YFOLED.drawLoadingBar(percent)

The init block must be placed before this.

Example: Counter

The following code is a simple counter that displays an increasing number every second.

YFOLED.init(64, 128)
let item = 0
basic.forever(() => {
    basic.pause(1000)
    item += 1
    YFOLED.showNumber(item)
})

License

MIT

Copyright (c) 2021, YFROBOT

Supported targets

  • for PXT/microbit (The metadata above is needed for package search.)

About

YFROBOT 0.96 OLED

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published