makecode I2C LCD1602 package for microbit
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
parts add parts for simulator Nov 18, 2018
.gitignore first commit Mar 3, 2018
LCD1602_I2C.ts rename main.ts to LCD1602_I2C.ts Nov 18, 2018
LICENSE modify License declar Mar 4, 2018
README.md update README.md Nov 18, 2018
_config.yml Set theme jekyll-theme-architect Mar 3, 2018
demo.jpg add demo.jpg Mar 3, 2018
icon.png new icon.png Nov 18, 2018
lcd.jpg first commit Mar 3, 2018
pxt.json rename main.ts to LCD1602_I2C.ts Nov 18, 2018
pxtparts.json add parts for simulator Nov 18, 2018
test.ts add auto address feature Oct 29, 2018

README.md

i2cLCD1602

makecode I2C LCD1602 package for micro:bit

Author: shaoziyang
Date: 2018.Mar

Add extension

open your microbit makecode project, in Extension, paste

https://github.com/makecode-packages/i2cLCD1602

to search box then search.

Basic usage

let item = 0
I2C_LCD1602.LcdInit(0)
I2C_LCD1602.ShowString("Hello", 0, 0)
basic.forever(() => {
    item += 1
    I2C_LCD1602.ShowNumber(item, 0, 1)
    basic.pause(1000)
})

I2C Address

  • PCF8574: 39
  • PCF8574A: 63
  • Auto: 0

API

  • LcdInit(Addr: number)
    Initial LCD
    Addr: I2C Address. If Addr is zero, it will try to recognition correctly address automaticly.

  • ShowNumber(n: number, x: number, y: number)
    show a number in LCD at given position.
    n: number will be show
    x: is LCD column position, [0 - 15]
    y: is LCD row position, [0 - 1]

  • ShowString(s: string, x: number, y: number)
    show a string in LCD at given position.
    s: string will be show
    x: is LCD column position, [0 - 15]
    y: is LCD row position, [0 - 1]

  • on()
    turn on LCD

  • off()
    turn off LCD

  • clear()
    clear LCD content

  • BacklightOn()
    turn on LCD backlight

  • BacklightOff()
    turn off LCD backlight

  • shl() shift left screen

  • shr() shift right screen

Demo

License

MIT

Copyright (c) 2018, microbit/micropython Chinese community

Supported targets

  • for PXT/microbit

From microbit/micropython Chinese community