microbit

micro:bit Project 3: Sunshine micro:bit



 Sunshine micro:bit


正面大图:

 

Difficulty Level

Level1

Part List:

l 1xGrove - Light Sensor

l 1xGrove Shield for micro:bit

l 1xmicro:bit

Description

Inthis demo you will learn how to use the LED bar graph on your micro:bit to showthe current light level. The stronger the light is, the more LEDS will beturned on.

Steps

1.        
Add basic block on start, the add variableblock setitem to 0, rename “item”to “Light Sensor” and replace “0”with pin block“analog read pin P0”

2.        
Add basic block “on forever”, then Add LED block “plotbar graph of…..up to”, amend the block to be “plot bar graph of Light Sensor upto 255”

3.        Add basic block“pause(ms)”, change the value to “10”

4.        Click Download andtransfer your code in your micro:bit!

5.        Use your hand tohold the light sensor and see how those Leds change.

mollyAug 31,2017 14:24 PMAdd Comment

Comment

Popular Topics