Giter Site home page Giter Site logo

mo-sw-dev / pxt-calliope-oled-ssd1306 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bcomak3r/pxt-calliope-oled-ssd1306

0.0 1.0 0.0 3.03 MB

MakeCode blocks for OLED displays driven by SSD1306 controllers for calliope mini (micro:bit) boards

License: MIT License

C++ 61.55% C 23.79% Makefile 0.09% TypeScript 14.56%

pxt-calliope-oled-ssd1306's Introduction

Forked from https://github.com/xuefengedu/pxt-oled-ssd1306_CN which bases on https://github.com/Tinkertanker/pxt-oled-ssd1306

Handles OLED using controller chip SSD1306 for calliope mini (micro:bit) boards in MakeCode (PXT)

  1. Forked
  2. Changed name space to oled / oled_ssd1306 and menu entry name to oled:ssd1306
  3. ! Warning: under development !
  4. Added more functions:
    "oled_ssd1306.setTextCursorToXY|block": " x %x|y %y",
    "oled_ssd1306.setTextCursorToRowCol|block": " row %row|column %column"

Usage

  1. Open editor https://makecode.calliope.cc/
  2. Load additional package https://github.com/BCoDTT/pxt-calliope-SSD1306
  3. The additional menu entry OLED_SSD1306 is available

Screen shots

None

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. Connect the OLED display with the I2C (A0) port on the calliope mini or in one of the I2C ports on a break out board.

! Attention: The pinout of the (my) OLED board is GND | VCC | SCL | SDA, so to connect it correctly to the calliope mini I2C port (A0) the wires for SCL and SDA have to be crossed.

Blocks

Initialize OLED Display

Initializes the OLED display.

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

oled_ssd1306.init(64, 128);

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

Set text cursor to coodrinates x/y

Sets the text cursor to the coordinates x/y for printing a string on the OLED module.

oled_ssd1306.setTextCursorToXY(x, y)

Set text cursor to row/column

Sets the text cursor to the row/column for printing a string on the OLED module.

oled_ssd1306.setTextCursorToRowColumn(row, column)

Show String

Displays a string on the OLED module.

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

The init block must be placed before this.

Show Number

Displays a number on the OLED module.

oled_ssd1306.showNumber(123)

The init block must be placed before this.

Clear Display

Clears the display.

oled_ssd1306.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_ssd1306.init(64, 128)
let item = 0
basic.forever(() => {
    basic.pause(1000)
    item += 1
    oled_ssd1306.showNumber(item)
})

Footnotes

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

Supported targets

  • for PXT/microbit (The metadata above is needed for package search.)
pxt-calliope-oled-ssd1306=github:BCoMak3r/pxt-calliope-oled-ssd1306

pxt-calliope-oled-ssd1306's People

Contributors

bcomak3r avatar

Watchers

James Cloos avatar

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.