A device of a cart includes a control, a speed regulating potentiometer, a microprocessor,
a digital-to-analogue converter, a motor controlling unit, and a switch; the control
is angularly displaceable and near to handlebars of the cart; the potentiometer
is connected to the control so as to output a voltage, which depends on displacement
of the control; the microprocessor can produce digital signals according to the
output voltage of the potentiometer; the converter is used for converting the digital
signals into analogue voltage; the motor controlling unit is used for making a
motor run at a variable-speed mode, at which mode the speed of the motor will depend
on output voltage of the converter; immediately after the rider presses the switch,
the microprocessor will ignore output voltage of the potentiometer, and start and
continue giving a same digital signal to the converter so that the motor starts
running at constant speed.