Example Code for micro:bit-MakeCode-Send Message to Twitter (IFFTT)

when you get up in the morning, press down button A and B, send the temperature and light intensity to Twitter.

Hardware Preparation

  • micro:bit board: Quantity 1
  • Micro: IoT expansion board: Quantity 1
  • IFFTT platform access: Quantity 1
  • Twitter account: 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 "Twitter".
    1. Click That, search Twitter, select "post a tweet", complete the action fields.

Sample Code

Makecode Programs: Send message to Twitter

Result

press down button A, send the message to Twitter: Hi DFROBOT and the current temperature; Press down button B, send: HI DFROBOT,and the current light intensity.

Was this article helpful?

TOP