-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMicroBit_LightSensorLevel.py
More file actions
26 lines (20 loc) · 931 Bytes
/
MicroBit_LightSensorLevel.py
File metadata and controls
26 lines (20 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This script will use the Microbit LEDs as a light sensor and display the light level (V1, Firmware 0249, Sept 2021)
# IDE (Integrated Development Environment)
# https://codewith.mu
# Bill of Materials
# Microbit v2 Go Kit
# https://www.adafruit.com/product/4834
# Source code
# https://microbit.org/projects/make-it-code-it/sunlight-sensor/?editor=python#step-2:-code-it
# https://microbit.org/projects/make-it-code-it/light-alarm/?editor=python
# https://github.com/AnchorageBot
# Engineering background
# https://lancaster-university.github.io/microbit-docs/extras/light-sensing/
# https://core-electronics.com.au/tutorials/micropython-workshop-for-microbit.html
# https://microbit-micropython.readthedocs.io/en/v1.0.1/tutorials/images.html
from microbit import *
while True:
if display.read_light_level() > 25:
display.scroll(display.read_light_level())
else:
display.clear()