Today, we will make a revolution indicator, which can represent the revolution with the color of the indicator light, the brighter the light is, the faster the motor rotates.
We can just correspond the set value of the potentiometer to the brightness of the colorLED.
Required Program Blocks
ColorLED preparation, connect it to pin 4 of Hub.
Variable A is for storing the speed of the motor.
Save the value of the rotating potentiometer in A.
Map A from 0-1023 to 0-255.
Set the brightness of the color LED to A.
Set the rotation speed of the motor of interface 1A1B to A.