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.