5. Case 04: The Birds Nest¶
The human activities have changed a lot on the living environment of birds, the birds are not easy to find places to rest and food in cities, therefore, we could make a bird nest for them to live.
Control the lighting of LEDs in different colors from the tilted status of the micro:bit to remind people of protecting the nests.
5.5. Hardware Connection¶
Connect the green LED to P1, the yellow to P2 and the red to P9 on IoT:bit.
5.6. Software Programming¶
Click “Advanced” in the MakeCode to see more choices.
For programming, we need to add a package: click “Extensions” at the bottom of the MakeCode drawer and search with “iot-environment-kit” in the dialogue box to download it.
Notice: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.
Turn on the lights in accordance with the micro:bit status, if the micro:bit logo faces upwards it means the nest is in a normal status with the green led turnning on; if the yellow led lights on, it means the micro:bit is in a tilted status which means the nest is tilting to the left/right side; or the red means the nest is upside down now and it requires a re-construction.
The nest is in a normal status if the green led is turnning on; if the yellow led lights on, it means the micro:bit is in a tilted status which means the nest is tilting to the left/right side; or the red means the nest is upside down now and it requires a re-construction.