Instructions
• max_power – This is the maximum power, you can leave this as 1023
• power_step – This is the power range divided by 9 and will be the amount
of power change that results from one step more of speed.
• Speed – The speed from 0 (off) to 9 (maximum)
The forever loop is used to continuously set the power level to match the speed.
The case of the speed being 0 is treated as a special case, to set the power to 0,
otherwise the motor may buzz without actually turning when the speed is 0.
The on button pressed blocks are very similar to each other. The block for button A
subtracts 1 from speed while making sure that speed does not fall below zero and
then displays the new speed and uses analog write to set the power output of pin 0.
The on button pressed for B does the same kind of thing, but adding 1 to speed.
Page 17