BhavithiranSC Lim
Published © MIT

EDU:BIT Night Light | MicroPython

Guide to program Night Light with EDU:BIT (project kit for micro:bit) using MicroPython

BeginnerFull instructions provided30 minutes2
EDU:BIT Night Light | MicroPython

Things used in this project

Hardware components

EDU:BIT
Cytron Technologies EDU:BIT
×1

Software apps and online services

Mu
Python Editor for micro:bit

Story

Read more

Code

Night Light

Python
This tutorial's full code
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

Credits

Bhavithiran

Bhavithiran

10 projects • 4 followers
SC Lim

SC Lim

8 projects • 3 followers

Comments

Add projectSign up / LoginAbout BBC micro:bit