> For the complete documentation index, see [llms.txt](https://learn.pakronics.com.au/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.pakronics.com.au/halocode-1/code-with-mu-a-simple-python-editor/examples/basic-project/energy-ring.md).

# Energy Ring

Shake your hand to power HaloCode. As HaloCode is "charging", more LEDs will light up

![](/files/-Lpg6_aHdnxAqK_g_StU)

1\. Choose Variables block, and click "Make a Variable". Name the variable "n"

![](/files/-Lpg6_aIKUEqqHMWSrnF)

2\. Add an Events block when button is pressed, a Lighting block light off LED (), and a Variables block set (n) to (). Input "1"

![](/files/-Lpg6_aJSXOEFXcFTEyi)

3\. Add a Control block if () then (), an Operators block () > (), and a Sensing block shaking strength. Input "20"

![](/files/-Lpg6_aKmiRN_ls4U4wI)

4\. Add a Lighting block light up LED () with color R()G()B(), two Variables block n and change (n) by (1), a Control block wait () secs. Input "0.2"

![](/files/-Lpg6_aLHM-Y72_NvLta)

5\. Add a Control block repeat until (), an Operators block () = (), a Variables block n. Input "12"

![](/files/-Lpg6_aMhUuztMsXSkL0)

6\. Add a Lighting block all LEDs light up (). Set the color to blue

![](/files/-Lpg6_aN19ecq7l8jFnT)

7\. Toggle on Upload mode.
