Things used in this project

Hardware components:
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
SparkFun Mini Photocell
×1
12002 04
Breadboard (generic)
×1
SparkFun micro:bit Breakout (with Headers)
×1
Microbitheart
micro:bit BBC micro:bit board
×1

Schematics

Wiring Guide
Microbit light sensor stlpc05oyg
Instructions building using block-based editor

Code

Light Sensor CodePython
Fairly straightforward code. See attached pdf for block-based example too.
from microbit import *

while True:
    lightSensor = pin0.read_analog()
    if lightSensor > 512:
        sun = Image("90909:"
                    "09990:"
                    "99999:"
                    "09990:"
                    "90909")
        display.show(sun)
    elif lightSensor < 512:
        moon = Image("99900:"
                     "09990:"
                     "00990:"
                     "09990:"
                     "99900")
        display.show(moon)

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Bikeyface Emoji Taillight (with Micro:bit)
Easy
  • 477
  • 12

Full instructions

Express yourself with your bike lights!

Make Your BBC Micro:Bit Talk Using MicroPython
Easy
  • 388
  • 8

Protip

Today, I am going to show you how to make your Micro:bit talk using a very easy programming language called MicroPython.

Display Your Name On Micro-Bit Using MicroPython
Easy
  • 353
  • 6

Full instructions

In this tutorial, I am going to show you how to code BBC micro:bit using MicroPython to display your name and other basic symbols.

magic button trick
Easy
  • 248
  • 4

Full instructions

Build a magic trick to amaze your friends that uses the micro:bit’s compass to detect a nearby magnet!

magic button trick

Team micromonsters

Getting Started with BBC Micro:Bit
Easy
  • 928
  • 11

Full instructions

This tutorial will show you the basics to get started with BBC micro bit.

Are You in Tune?
Easy
  • 580
  • 6

Work in progress

There are many ways/apps/tools to tune an ukulele, and now there is one more!

Add projectSign up / LoginAbout BBC micro:bit