1 Star 0 Fork 0

DFRobot/pxt-DFRobot_IoT_Ubidots

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.ts 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
zhangtang 提交于 2024-04-12 14:45 . add ubidots
input.onButtonPressed(Button.A, function () {
naturalScience.microIoT_SendMessage("78", naturalScience.TOPIC.topic_0)
})
input.onButtonPressed(Button.AB, function () {
naturalScience.microIoT_http_post("12", "344", "44")
})
input.onButtonPressed(Button.B, function () {
naturalScience.microIoT_http_TK_GET(
"95",
"12",
"8",
"",
"",
"",
""
)
})
naturalScience.microIoT_WIFI("hitest", "12345678")
naturalScience.microIoT_ThingSpeak_configura("yourKey")
naturalScience.microIoT_http_IFTTT("BBB", "dtpfTlU3Wqa8y0HRh77xXE")
naturalScience.microIoT_MQTT(
"rHpr0RcWR",
"9NtrAg5ZRz",
"DN5FYlDZR",
naturalScience.SERVERS.China
)
naturalScience.setTDSK(1.1)
naturalScience.mototRun(DIR.CW, 100)
basic.forever(function () {
naturalScience.requstdata()
naturalScience.setOLEDShowString(1, 7, 1, "UV:" + naturalScience.getUltraviolet())
naturalScience.setOLEDShowString(8, 16, 1, "-SOD:" + naturalScience.getSound())
naturalScience.setOLEDShowString(1, 7, 2, "TC:" + convertToText(naturalScience.getTVOC(CT.TVOC)))
naturalScience.setOLEDShowString(8, 16, 2, "-CO2:" + convertToText(naturalScience.getTVOC(CT.CO2)))
naturalScience.setOLEDShowString(1, 7, 3, "TE:" + naturalScience.getBME(BME.TEMP))
naturalScience.setOLEDShowString(8, 16, 3, "-WTE:" + naturalScience.getWatertemp())
naturalScience.setOLEDShowString(1, 7, 4, "LI:" + convertToText(naturalScience.getLight()))
naturalScience.setOLEDShowString(8, 16, 4, "-TDS:" + convertToText(naturalScience.getTDS()))
naturalScience.setOLEDShowString(1, 16, 5, "HU:" + naturalScience.getBME(BME.HUM))
naturalScience.setOLEDShowString(1, 16, 6, "PE:" + naturalScience.getBME(BME.PRESSURE))
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dfrobot/pxt-DFRobot_IoT_Ubidots.git
git@gitee.com:dfrobot/pxt-DFRobot_IoT_Ubidots.git
dfrobot
pxt-DFRobot_IoT_Ubidots
pxt-DFRobot_IoT_Ubidots
master

搜索帮助