VESC Tool ships with a built-in collection of example scripts accessible from the scripting editor menu. These examples are a good starting point for many common tasks.
Simple loop with status printing
The most basic VESC script structure: an initialization block followed by an infinite loop that periodically prints status and resets the motor timeout.Blinking AUX output
Toggle the AUX1 output on and off at 1 Hz. This is the VESC equivalent of a “blink LED” example.Reading motor RPM and reacting
Read the motor RPM and apply different behavior depending on the speed.Controlling motor speed with set-duty
Ramp the motor duty cycle from 0 to 30% over 3 seconds, hold it, then brake.RPM control with soft start
Useset-rpm to drive a motor to a target speed, reading configuration to stay within safe limits.
Reading configuration values
Inspect key motor configuration parameters at startup. Useful for debugging or adapting script behavior to the configured hardware.IMU tilt detection
Read the IMU roll angle and print a warning when the board tilts beyond a threshold.CAN bus communication
Sending a raw CAN frame
Reading motor state from another VESC over CAN
Usecan-cmd to execute a LispBM expression on a remote VESC and return the result:
