Skip to content

Commit 030ffbf

Browse files
committed
rename main.ts to LCD1602_I2C.ts
1 parent 1beccca commit 030ffbf

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

main.ts renamed to LCD1602_I2C.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Custom blocks
99
*/
10-
//% weight=100 color=#0fbc11 icon="▀"
10+
//% weight=20 color=#0fbc11 icon="▀"
1111
namespace I2C_LCD1602 {
1212
let i2cAddr: number // 0x3F: PCF8574A, 0x27: PCF8574
1313
let BK: number // backlight control
@@ -77,6 +77,7 @@ namespace I2C_LCD1602 {
7777
*/
7878
//% blockId="I2C_LCD1620_SET_ADDRESS" block="LCD initialize with Address %addr"
7979
//% weight=100 blockGap=8
80+
//% parts=LCD1602_I2C trackArgs=0
8081
export function LcdInit(Addr: number) {
8182
if (Addr == 0) i2cAddr = AutoAddr()
8283
else i2cAddr = Addr
@@ -104,6 +105,7 @@ namespace I2C_LCD1602 {
104105
//% weight=90 blockGap=8
105106
//% x.min=0 x.max=15
106107
//% y.min=0 y.max=1
108+
//% parts=LCD1602_I2C trackArgs=0
107109
export function ShowNumber(n: number, x: number, y: number): void {
108110
let s = n.toString()
109111
ShowString(s, x, y)
@@ -119,6 +121,7 @@ namespace I2C_LCD1602 {
119121
//% weight=90 blockGap=8
120122
//% x.min=0 x.max=15
121123
//% y.min=0 y.max=1
124+
//% parts=LCD1602_I2C trackArgs=0
122125
export function ShowString(s: string, x: number, y: number): void {
123126
let a: number
124127

@@ -139,6 +142,7 @@ namespace I2C_LCD1602 {
139142
*/
140143
//% blockId="I2C_LCD1620_ON" block="turn on LCD"
141144
//% weight=81 blockGap=8
145+
//% parts=LCD1602_I2C trackArgs=0
142146
export function on(): void {
143147
cmd(0x0C)
144148
}
@@ -148,6 +152,7 @@ namespace I2C_LCD1602 {
148152
*/
149153
//% blockId="I2C_LCD1620_OFF" block="turn off LCD"
150154
//% weight=80 blockGap=8
155+
//% parts=LCD1602_I2C trackArgs=0
151156
export function off(): void {
152157
cmd(0x08)
153158
}
@@ -157,6 +162,7 @@ namespace I2C_LCD1602 {
157162
*/
158163
//% blockId="I2C_LCD1620_CLEAR" block="clear LCD"
159164
//% weight=85 blockGap=8
165+
//% parts=LCD1602_I2C trackArgs=0
160166
export function clear(): void {
161167
cmd(0x01)
162168
}
@@ -166,6 +172,7 @@ namespace I2C_LCD1602 {
166172
*/
167173
//% blockId="I2C_LCD1620_BACKLIGHT_ON" block="turn on backlight"
168174
//% weight=71 blockGap=8
175+
//% parts=LCD1602_I2C trackArgs=0
169176
export function BacklightOn(): void {
170177
BK = 8
171178
cmd(0)
@@ -176,6 +183,7 @@ namespace I2C_LCD1602 {
176183
*/
177184
//% blockId="I2C_LCD1620_BACKLIGHT_OFF" block="turn off backlight"
178185
//% weight=70 blockGap=8
186+
//% parts=LCD1602_I2C trackArgs=0
179187
export function BacklightOff(): void {
180188
BK = 0
181189
cmd(0)
@@ -186,6 +194,7 @@ namespace I2C_LCD1602 {
186194
*/
187195
//% blockId="I2C_LCD1620_SHL" block="Shift Left"
188196
//% weight=61 blockGap=8
197+
//% parts=LCD1602_I2C trackArgs=0
189198
export function shl(): void {
190199
cmd(0x18)
191200
}
@@ -195,6 +204,7 @@ namespace I2C_LCD1602 {
195204
*/
196205
//% blockId="I2C_LCD1620_SHR" block="Shift Right"
197206
//% weight=60 blockGap=8
207+
//% parts=LCD1602_I2C trackArgs=0
198208
export function shr(): void {
199209
cmd(0x1C)
200210
}

pxt.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "i2cLCD1602",
33
"version": "1.5.0",
4-
"description": "makecode I2C LCD1602 package for micro:bit",
4+
"description": "makecode I2C LCD1602 extension for micro:bit",
55
"license": "MIT",
66
"dependencies": {
77
"core": "*"
88
},
99
"files": [
1010
"README.md",
11-
"main.ts"
11+
"pxtparts.json",
12+
"LCD1602_I2C.ts",
13+
"parts/LCD1602_I2C.svg"
1214
],
1315
"testFiles": [
1416
"test.ts"

0 commit comments

Comments
 (0)