Table of Contents:
The SL06 xChip is a light sensor that is packed with features:
- It measures lux.
- It detects proximity
- It can recognise colours
- It includes gesture recognition
To write code that uses the SL06 in MakeCode you will need to load the SL06 extension:
- Open MakeCode and start a new project
- Click on Advanced / Extensions
- Type in XinaBox/pxt-SL06
- Click on search
- Select the SL06 tile
After a few moments the extension should load and you will see a new tab in the left hand menu titled SL06.
Given that the SL06 is so versatile we ideally need to write four different Hello World! programs.
The code below shows you how to use the proximity sensor:
NB: When using the SL06 with a BBC micro:bit always provide power to the IM01 and NOT to the micro:bit. The micro:bit is only able to deliver 3.3V, and the SL06 requires more power to work properly. Powering via the IM01 allows components in the circuit to draw more power.
- Connecting it up
- Loading the extension and Hello World!
- Selecting the SL06 functional mode
- Providing power to the SL06
- Using Proximity Mode
- Using Light Mode
- Using Gesture mode
- [click here to download all how-to guides in a single PDF]
Use the gesture sensing to build a version of the classic game Simon: