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

Wiring Diagram

Plug the micro:bit board into the Micro: IoT expansion board.

Other Preparation Work

    1. Enter IFFTT website, register an account: https://ifttt.com
    1. Sign in and enter the My Applets page, click New Applets.
    1. Create an Applet: click This, input webhooks, fill the Event Name as "Reminder".
    1. 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?

TOP