Start: program start + repeat forever
You need to read the sensor again and again. First place the yellow "when program starts" block and attach "forever" under it. Put "wait 0.1 seconds" inside, so it reads every 0.1 seconds.
- Open the official LEGO SPIKE App, make a new project and choose "Word Blocks".
- Drag "when program starts" from "Events". Then drag "forever" from "Control" and attach it underneath.
- Drag a "wait 1 seconds" block into forever and change the number to 0.1.