

We can see the green light illuminates as showed in the picture below. Let’s find a book or something else and place it on the top of device, then see what will happen. Or, you can download from the page below: If you don’t want to type these code by yourself, you can directly download the whole program from the link below: Or else, if no force is applied to the Crash Sensor, the red LED will blink continuously. When the Crash Sensor is pressed, the green Octopus LED will light up. Since there are only two conditions, we need only one ‘else-if’ statement. You can adjust the speed of blinking by changing the pause period. This part of the code allows the red LED to blink continuously. Step 3 – CodingĪfter that, use blocks under the Tinkercademy section to initialize the OLED and Crash Sensor as shown in the picture Note: If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Projects file menu. This will open up a dialog box. Search for “ tinker kit” and then click it to download this package.

Click on Advanced in the Code drawer to see more code sections and look at the bottom of the Code Drawer for Extensions. We’ll need to add a package of code to be able to use our kit components. You should be able to plug it into any of the three rows. Lastly, plug in the OLED as shown in the picture above. Making sure that the colour of the wire follows the colour of the pins on the break out board, plug in the crash sensor to Pin 0 and the Octopus LED to Pin 8. Make something with Crash sensor and OLEDĬonnect the USB cable to the micro:bit and then to the breakout board as shown in the picture above.Make something with different types of LED.Get to know the Octopus LED, normal LED, Crash sensor and OLED.The OLED will display the status of the device. Otherwise, the green LED will light up continuously.

In this project, we are going to create a simple alarm device which will alert the owner if someone has stolen his or her property. The red LED will blink when the crash sensor detects that the object has been taken away. Contributors Chris Rush micro:bit Tinker Kit Project 04 – Simple Alarm Box What you will learn
