Gan ddefnyddio Microsoft Makecode ar gyfer Micro:Bit gallwn greu rhaglen sy'n goleuo golau coch yn ôl lefel golau, fel trwyn Rudolph. Mae hwn yn rhad ac am ddim i'w ddefnyddio heb fod angen mewngofnod neu gyfrif e-bost.
Os ydych chi'n newydd i ddefnyddio Micro:Bit, mae'r her hon yn gofyn am ddealltwriaeth o Sesiynau Un a Dau o'n Cyfres Gweithdy Micro:Bit.
Byddwn yn defnyddio stribed o 24 LED, sy'n gofyn am yr estyniad neopixel. Ewch i Sesiwn Pedwar o'n Cyfres Gweithdy Micro:Bit am ragor o wybodaeth.
Lefel Un: Gan ddefnyddio synwyryddion golau Micro:Bit trowch y stribed LED ymlaen pan fydd lefel y golau yn llai na 100. Dylai'r stribed LED ddiffodd wedyn pan fydd lefel y golau yn cynyddu i 100 neu uwch.
Lefel Dau: Dewch o hyd i ffordd i raglennu'r neopixel fel bod llai o olau yn golygu mwy o olau LED coch.
Lefel Tri: Mapiwch lefelau golau i'r stribed LED i greu'r un effaith â Lefel Dau. Ymdrinnir â mapio yn Sesiwn Pump o'n Cyfres Gweithdy Micro:Bit
Lefel Pedwar: Allwch chi ddylunio cylched ar gyfer Arduino i gwrdd â'r holl heriau hyn gan ddefnyddio Tinkercad - am ragor o wybodaeth a/neu gymorth, ewch i'n Cyfres Gweithdai Electroneg. Yn yr achos hwn, defnyddiwch ddisgleirdeb LED coch yn hytrach na defnyddio stribed neopixel.
Using Microsoft Makecode for Micro:Bits we can create a program that lights up a red light according to light level, like Rudolph's nose. This is free to use without needing a login or email account.
If you are new to using a Micro:Bit, this challenge requires an understanding of Sessions One and Two from our Micro:Bit Workshop Series.
We shall use a strip of 24 LEDs, which requires the neopixel extension. Visit Session Four of our Micro:Bit Workshop Series for more information.
Level One: Using the Micro:Bit's light sensors have the LED strip turn on when the light level is less than 100. The LED strip should then turn off again when the light level increases to 100 or above.
Level Two: Find a way to program the neopixel so that the less light, the more red LEDs.
Level Three: Map the light levels to the LED strip to create the same affect as Level Two. Mapping is covered in Session Five of our Micro:Bit Workshop Series
Level Four: Can you design a circuit for an Arduino to meet all these challenges using Tinkercad - for more information and/or support, visit our Electronics Workshop Series. In this case, use the brightness of a red LED instead of using a neopixel strip.