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 potientio bit, IR bit and RGB bit 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 night light
from edubit import *
import neopixel
np = neopixel.NeoPixel(pin13, 4)
display.show(Image.HAPPY) # show happy face on microbit display
while True:
init() # initialize EDU:BIT
pValue = read_pot_value() >> 2 # convert 1023 to 255
if is_IR_sensor_triggered(): # if IR sensor is triggered
for LED in range(4):
np[LED] = 255,pValue,50 # set all rgb pixel
np.show() # show color on rgb pixel
UPLOAD
MU EDITOR
Connect EDU:BIT to your computer using a USB cable. Click on the Flash button to upload the program.
Python editor for 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