first commit

This commit is contained in:
lzty634158 2018-03-26 10:07:21 +08:00
commit 83e4c406f5
13 changed files with 1227 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
built
node_modules
yotta_modules
yotta_targets
pxt_modules
*.db
*.tgz

19
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,19 @@
{
"editor.formatOnType": true,
"files.autoSave": "afterDelay",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/built/**": true,
"**/node_modules/**": true,
"**/yotta_modules/**": true,
"**/yotta_targets": true,
"**/pxt_modules/**": true
},
"search.exclude": {
"**/built": true,
"**/node_modules": true,
"**/yotta_modules": true,
"**/yotta_targets": true,
"**/pxt_modules": true
}
}

36
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,36 @@
// A task runner that calls the PXT compiler and
{
"version": "0.1.0",
// The command is pxt. Assumes that PXT has been installed using npm install -g pxt
"command": "pxt",
// The command is a shell script
"isShellCommand": true,
// Show the output window always.
"showOutput": "always",
"tasks": [{
"taskName": "deploy",
"isBuildCommand": true,
"problemMatcher": "$tsc",
"args": [""]
}, {
"taskName": "build",
"isTestCommand": true,
"problemMatcher": "$tsc",
"args": [""]
}, {
"taskName": "clean",
"isTestCommand": true,
"problemMatcher": "$tsc",
"args": [""]
}, {
"taskName": "serial",
"isTestCommand": true,
"problemMatcher": "$tsc",
"args": [""]
}]
}

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017 Riven
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
all: deploy
build:
pxt build
deploy:
pxt deploy
test:
pxt test

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# mbit
Extension for Yahboom mbit
## License
MIT
## Supported targets
* for PXT/microbit
(The metadata above is needed for package search.)

View File

@ -0,0 +1,33 @@
{
"mbit_显示类.LED1|block": "LED灯|引脚 %pin|状态 %value",
"mbit_显示类.LED2|block": "LED灯|引脚 %pin|亮度 %value",
"mbit_显示类.BreathLED|block": "呼吸灯|引脚 %pin",
"mbit_显示类.RGB|block": "RGB七彩灯|引脚R %pin1|引脚G %pin2|引脚B %pin3|红色 %value1|绿色 %value2|蓝色 %value3",
"mbit_显示类.RGB2|block": "RGB七彩灯|引脚R %pin1|引脚G %pin2|引脚B %pin3|显示 %value",
"mbit_输入类.TouchPad|block": "触摸开关|引脚 %pin|返回 %value",
"mbit_输入类.Rocker|block": "遥杆|VRX %pin1|VRY %pin2|SW %pin3|返回 %value",
"mbit_输入类.Button|block": "按键|引脚 %pin|返回 %value",
"mbit_传感器类.Voice_Sensor|block": "声音传感器|引脚 %pin|返回 %value",
"mbit_传感器类.IR_Sensor|block": "红外传感器|引脚 %pin| |%value|障碍物",
"mbit_传感器类.IR_Send|block": "红外发射|引脚 %pin",
"mbit_传感器类.Ultrasonic|block": "超声波|发射管脚 %Trig|接收管脚 %Echo",
"mbit_音乐类.Buzzer|block": "有源蜂鸣器|引脚 %pin|值 %value",
"mbit_电机类.Fan|block": "风扇|引脚 %pin|速度 %value",
"mbit_电机类.Servo|block": "舵机|引脚 %pin|角度 %value",
"mbit_小车类.RGB_Car_Big|block": "小车RGB探照灯|红色 %value1|绿色 %value2|蓝色 %value3",
"mbit_小车类.RGB_Car_Big2|block": "小车RGB探照灯|选择车灯颜色 %value",
"mbit_小车类.Ultrasonic_Car|block": "超声波返回cm",
"mbit_小车类.RGB_Car_Program|block": "七彩流水灯",
"mbit_小车类.Music_Car|block": "小车音乐播放|%index",
"mbit_小车类.Line_Sensor|block": "巡线传感器|位置 %direct|检测到 %value",
"mbit_小车类.Avoid_Sensor|block": "避障传感器|检测到 %value",
"mbit_小车类.Servo_Car|block": "小车舵机|编号 %num|角度 %value",
"mbit_小车类.CarCtrl|block": "小车控制|%index",
"mbit_小车类.CarCtrlSpeed|block": "小车控制|%index|速度 %speed"
}

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

1034
main.ts Normal file

File diff suppressed because it is too large Load Diff

23
pxt.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "mbit",
"version": "1.1.0",
"description": "Extension for YahBoom m:bit",
"license": "MIT",
"dependencies": {
"core": "*",
"neopixel": "github:microsoft/pxt-neopixel#v0.3.10",
"Mbit_IR": "github:lzty634158/yahboom_mbit_IR"
},
"files": [
"README.md",
"main.ts",
"_locales/zh/mbit-strings.json"
],
"testFiles": [
"test.ts"
],
"public": true
}

23
pxt.json.bak Normal file
View File

@ -0,0 +1,23 @@
{
"name": "mbit",
"version": "1.1.0",
"description": "Extension for YahBoom m:bit",
"license": "MIT",
"dependencies": {
"core": "*",
"neopixel": "github:microsoft/pxt-neopixel#v0.3.10",
"Mbit_IR": "github:lzty634158/yahboom_mbit_IR#v1.0.0"
},
"files": [
"README.md",
"main.ts",
"_locales/zh/mbit-strings.json"
],
"testFiles": [
"test.ts"
],
"public": true
}

1
test.ts Normal file
View File

@ -0,0 +1 @@
// tests go here; this will not be compiled when this package is used as a library

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "es5",
"noImplicitAny": true,
"outDir": "built",
"rootDir": "."
},
"exclude": ["pxt_modules/**/*test.ts"]
}