Introduction to Halocode's motion sensor
The motion sensor detects how Halocode moves, including shaking strength.
Set the range of shaking strength
1. Drag an Operators blockto the Scripts area, and change the value of the second parameter to "30". Add a Sensing block to the first parameter.
2. Add a Control block.
Set LED animation
3. Add a Lighting block, and a Control block . Add another Lighting block to light off all LEDs in 1 second.
4. Likewise, for shaking strength greater than 60, we can duplicate the script. Change the value to 60 and LED color to red.
Add event and control
5. Add an Events blockand a Control block .
Read shaking strength
6. Check the box for Sensing block.
7. Shake Halocode! See if you can make the LED ring light up red.