EDU:BIT is a beginner-friendly micro:bit kit specially designed to encourage kids to explore STEAM and learn coding.
MicroPython is an open source Python programming language interpreter that runs on small embedded development boards.
This project uses the traffic light bit, music bit, button bit, IR and a dc motor included in the kit.
SOFTWARE SETUPMU EDITOR
Step 1: Download and install MU editor
Download MU editor at: https://codewith.mu/en/download
Click on the downloaded file to install MU editor
Step 2: Add module
Download MicroPython module from GitHub: https://github.com/Bhavithiran97/micropython-edubit
Copy edubit.py file and paste it in your computer's mu_code folder
- On Windows, the path is: C:\Users<username>\mu_code
- On Macintosh, the path is: Macintosh HD>Users>username>mu_code
Connect EDU:BIT to your computer using a USB cable and open MU editor.
Click in the Files button in the MU editor
A file panel will appear in the bottom of the editor
Drag and drop edubit.py from the right panel to left panel
Python editor for micro:bit
Step 1: Open Python Editor
Open Python editor at: https://python.microbit.org/v/2.0
Step 2: Add module
Download MicroPython module from GitHub: https://github.com/Bhavithiran97/micropython-edubit
Click on the Load/Save button in the editor
Click Show File (1) and Add file button
Add edubit.py to the editor
CODING
To program the EDU:BIT you need to:
- Use
from edubit import *
at the top of your program - Use
init()
inside awhile True
loop to monitor the power switch and reset microbit when power cycled.
Here is the example code for object counter with mini conveyor
from edubit import *
import music # import music module
count = 0 # set 'count' variable to 0
while True:
init() # initialize EDU:BIT
if is_IR_sensor_triggered(): # IR sensor triggered
count += 1
music.play(music.BA_DING) # play melody
if button_a.is_pressed(): # button A pressed
run_motor(M1,Forward, speed=200) # run motor M1 at speed 200
set_led(Red, 0)
set_led(Green, 1) # turn on green led
if button_b.is_pressed(): # button B pressed
brake_motor(M1) # brakes motor
set_led(Red, 1) # turn on red led
set_led(Green, 0)
count = 0
display.show(count) # show count value in microbit display
UPLOAD
MUEDITOR
Connect EDU:BIT to your computer using a USB cable. Click on the Flash button to upload the program.
Pythoneditorfor micro:bit
Connect EDU:BIT to your computer using a USB cable. Click on the Download button and download it into microbit folder to upload the program.
TESTING
Comments
Please log in or sign up to comment.