Light Paintbrush

Paint with light in midair!

Source: https://learn.adafruit.com/lightpaint-cplay/

Use these code blocks in this learn project.

Code for: Code the Light Paintbrush

------------…analog readpinA1sensorValue010230225mapfrom lowhighto lowhighacceleration (mg)xacceleration (mg)yifthenelse ifthenelse ifthenelse ifthenX1023Y1023<andX1023<Y1023<andX1023Y1023andX1023<Y1023and65280setcto255setcto16711680setcto16776960setctobrightValcset all pixels toset brightnesssetYtosetXtosetbrightValtosetsensorValuetoforever2065280setctosetbrightValtoon start

Continuing with MakeCode

This learn project continues but now uses MakeCode:

https://learn.adafruit.com/lightpaint-cplay/makecode-for-circuit-playground-express

analog readpinA1sensorValue010230225mapfrom lowhighto lowhighacceleration (mg)xacceleration (mg)yifthenelse ifthenelse ifthenelse ifthenX1023Y1023<andX1023<Y1023<andX1023Y1023andX1023<Y1023and65280setcto255setcto16711680setcto16776960setctobrightValcset all pixels toset brightnesssetYtosetXtosetbrightValtosetsensorValuetoforever2065280setctosetbrightValtoon start------------…