Giter Site home page Giter Site logo

pxt-oled-ssd1306_cn's Introduction

Forked from https://github.com/Tinkertanker/pxt-oled-ssd1306

SSD1306 OLED液晶micro:bit pxt扩展包

  1. Translate into Chinese Simplified
  2. Add more functions:
    "OLED.drawCircle|block": "画圆 x %x|y %y|r %r",
    "OLED.fillCircle|block": "填充圆 x %x|y %y|r %r",
    "OLED.drawLine|block": "画线 x0 %x0|y0 %y0|x1 %x1|y1 %y1",
    "OLED.drawRect|block": "画矩形 x %x|y %y|w %w|h %h",
    "OLED.fillRect|block": "填充矩形 x %x|y %y|w %w|h %h",
    "OLED.drawRoundRect|block": "画带圆角的矩形 x %x|y %y|w %w|h %h|r %r",
    "OLED.fillRoundRect|block": "填充带圆角的矩形 x %x|y %y|w %w|h %h|r %r",
    "OLED.drawTriangle|block": "画三角形 x0 %x0|y0 %y0|x1 %x1|y1 %y1|x2 %x2|y2 %y2",
    "OLED.fillTriangle|block": "填充三角形 x0 %x0|y0 %y0|x1 %x1|y1 %y1|x2 %x2|y2 %y2"

Usage

1.打开https://makecode.microbit.org/

2.积木块列表中点击“高级”,拉到最下面有个“添加软件包”

3.搜索框中输入https://github.com/xuefengedu/pxt-oled-ssd1306_CN ,点击搜索按钮,点击下面显示的软件包“SSD1306_OLED 用户提供的软件包,非微软维护。SSD1306 OLED液晶micro:bit pxt扩展包”

Screen shots

SSD1306 makecode picture:

Alt text

sample 1 hex download 点击链接后,页面上有3个按钮:“Raw”按钮,“Blame”按钮,“History”按钮,在“Raw”按钮上右键,另存为,进行下载。

sample 2 hex download 比sample 1多加了开始时设置画图显示为关闭,结束时再一次性显示画图的结果。而不是像第一次那样每次画图都显示,第一次每画一笔都发送数据去显示一次,那样效率有点低。

点击上面的链接后,页面上有3个按钮:“Raw”按钮,“Blame”按钮,“History”按钮,在“Raw”按钮上右键,另存为,进行下载。

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

SSD1306 OLED MakeCode Package Build Status

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

Hardware Setup

  1. Insert the OLED display into the I2C ports on the break out board.

Blocks

Initialize OLED Display

Initializes the OLED display.

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

OLED.init(64, 128);

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

Show String

Displays a string on the OLED module.

OLED.showString("hello, micro:bit!")

The init block must be placed before this.

Show Number

Displays a number on the OLED module.

OLED.showNumber(123)

The init block must be placed before this.

Clear Display

Clears the display.

OLED.clear()

The init block must be placed before this.

Example: Counter

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

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

Supported targets

  • for PXT/microbit

Footnotes

  1. Datasheet https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf

pxt-oled-ssd1306_cn's People

Contributors

firemansamm avatar ranaldmiao avatar xuefengedu avatar yjsoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pxt-oled-ssd1306_cn's Issues

String does not work...

Hello! I was impressed by your CPP functions, that works faster than ordinary *.JS library for 128x64 OLED... But unfortunately something wrong is with PRINT... When I upload your example .hex - it works, but when I recompile it - it does not... Can you help me please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.