Example Code for micro:bit-MakeCode-Send Message to iPhone (IFFTT)
the climate is changeable during the seasonal alterantion. Use the micro:bit to detect temperature. If temperature is more than 30 degree, send a message to iphone to notice the user to pay attention to heatstroke. If temperature is less than 20 degree, send a message to iphone to notice the user to protect themselves from the cold.
Hardware Preparation
- micro:bit board: Quantity 1
- Micro: IoT expansion board: Quantity 1
- IFFTT platform access: Quantity 1
- iPhone with IOS Reminders: Quantity 1
Software Preparation
- Makecode online graphical programming platform: https://makecode.microbit.org/
- Micro:IoT library: https://github.com/DFRobot/pxt-microIoT
- How to install an library?
- IFFTT account: https://ifttt.com
Wiring Diagram
Plug the micro:bit board into the Micro: IoT expansion board.
Other Preparation Work
-
- Enter IFFTT website, register an account: https://ifttt.com
-
- Sign in and enter the My Applets page, click New Applets.
-
- Create an Applet: click This, input webhooks, fill the Event Name as "Reminder".
-
- Click That, search IOS Reminders, select "add reminder to list".
Sample Code
Makecode: Send a message to iPhone
Result
Send a message to iPhone every 10 hours. When Temperature>30, send: the weather is so hot, please pay attention to heatstroke. When temperature<20, send: Cold outside, please put more clothes on.
Was this article helpful?
