So many resources for you to programme! Even without much background knowledge, you can build your IoT applications in few steps!
- Display parameters on OLED
microIoT.microIoT_initDisplay()
basic.forever(function () {
microIoT.microIoT_showUserText(0, "DFRobot")
microIoT.microIoT_showUserNumber(1, 2019)
basic.pause(1000)
microIoT.microIoT_clear()
basic.pause(1000)
})
- Press button A to send data to IoT
input.onButtonPressed(Button.A, function () {
microIoT.microIoT_SendMessage("mess", microIoT.TOPIC.topic_0)
})
microIoT.microIoT_WIFI("yourSSID", "yourPASSWORD")
microIoT.microIoT_MQTT(
"yourIotId",
"yourIotPwd",
"yourIotTopic",
microIoT.SERVERS.China
)
basic.forever(function () {
})
- Press button A to send data to ThingSpeak
input.onButtonPressed(Button.A, function () {
microIoT.microIoT_http_TK_GET(
"your write api key",
"DFRobot",
"2020",
"",
"",
"",
"",
"",
0
)
})
microIoT.microIoT_WIFI("yourSSID", "yourPASSWORD")
basic.forever(function () {
})
- Press A to send data to IFTTT
input.onButtonPressed(Button.A, function () {
microIoT.microIoT_http_post(
"",
"",
"",
10000
)
})
microIoT.microIoT_WIFI("yourSSID", "yourPASSWORD")
microIoT.microIoT_http_IFTTT("yourEvent", "yourKey")
basic.forever(function () {
})
- Press button A to light up RGB LEDs 0 to 3 in yellow
input.onButtonPressed(Button.A, function () {
microIoT.microIoT_setIndexColor(microIoT.microIoT_ledRange(0, 3), 0xffff00)
})
basic.forever(function () {
})
- Control servo and motor
microIoT.microIoT_ServoRun(microIoT.aServos.S1, 90)
microIoT.microIoT_MotorRun(microIoT.aMotors.M1, microIoT.Dir.CW, 0)
basic.forever(function () {
})
MIT
Copyright (c) 2020, microbit/micropython Chinese community
- for PXT/microbit (The metadata above is needed for package search.)