Theory:
All turtles are an endangered species. The mortality rate of turtles across all species varies and is currently unknown so this device we’ll make will both count our baby turtles when they hatch and also attempt to help them survive their race to the ocean. Baby turtles usually hatch during the late afternoon or night. They are also attracted to lights which make broods near urban areas much more likely to wander in the wrong direction and die without ever reaching the ocean. We’ll use the LED strip to shine red and attract more baby turtles toward the water while counting them as we send them off to the ocean. We’ll then send this information off to the researchers in the marine life research centre using radio.
Practical:
Import the neopixel and grove extensions.
SENDER:
Get a radio set group block from Radio. Set this number to your group number. Create a variable named count and set it to 0 in on start. Get the set strip to Neopixel at pin P0 with 30 leds block from Neopixel and put it into on start. Add a strip show colour red at the end.
Next, get an on Gesture block from grove and change the none to Right. We’ll get a change count by 1 block from Variables and put it into on Gesture. Finally, we’ll get a radio send number block from Radio and put it in on Gesture. We’ll get a round count block from Variables and put it into radio send number. This sends our number to our researchers.
RECEIVER:
For the receivers, they will get a radio set group block and set it to the same group number as their partner. We’ll create a variable named count and put the set count to zero block into an on radio received receivedNumber block from Radio. Finally we’ll put a show number block from basic into forever and slot a round count block into the show number block. We’ll then get a pause block from basic and change the value to 1 second (1000 ms). Flash one code each to two different microbits and test.
Turtle Sender: