Example Code for micro:bit-MakeCode-Smart Emojis
This article guides users through setting up and programming a micro:bit with IoT expansion to create smart emojis. It offers detailed instructions on hardware and software preparation, wiring diagrams, and sample code. Users can send commands through the Easy IoT platform to display various emoji patterns on the micro:bit, enhancing learning and creativity.
Hardware Preparation
- micro:bit board: Quantity 1
- Micro: IoT expansion board: Quantity 1
- DFRobot Easy IoT platform access: 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?
Wiring Diagram
Plug the micro:bit board into the Micro: IoT expansion board.
Other Preparation Work
- Open the Easy IoT website:http://iot.dfrobot.com.cn/
- Sign up/Sign in to Easy IoT.
- Add a new device to match your micro:bit, get the device topic.
Sample Code
Makecode Program: smart emojis
Result
- Enter Easy IoT webpage to send message to micro:bit and find the related Topic, click "send message".
- Input your command into the blank, and send it out. Send the message "yes", micro:bit displays "√"; "no", "×"; "cry", "crying face pattern"; "smile", "smiley face".
Was this article helpful?
