b4d1c42669 | ||
---|---|---|
.. | ||
audio | ||
motors | ||
servos | ||
README.md | ||
led_rainbow.py | ||
read_adcs.py | ||
read_encoders.py | ||
read_gpios.py | ||
reset_inventor.py |
README.md
Inventor 2040 W Micropython Examples
Function Examples
Read ADCs
Shows how to initialise and read the 3 ADC headers of Inventor 2040 W.
Read GPIOs
Shows how to initialise and read the 6 GPIO headers of Inventor 2040 W.
Read Encoders
Demonstrates how to read the angles of Inventor 2040 W's two encoders.
LED Rainbow
Displays a rotating rainbow pattern on Inventor 2040 W's onboard LED bars.
Reset Inventor
A simple program that resets Inventor 2040 W, turning off its LEDs, Motors, Servos, and Audio.
Motor Examples
Single Motor
Demonstrates how to control a motor on Inventor 2040 W.
Dual Motors
Demonstrates how to control both motors on Inventor 2040 W.
Motor Wave
An example of applying a wave pattern to Inventor 2040 W's motors and LEDs.
Position Control
An example of how to move a motor smoothly between random positions, with the help of it's attached encoder and PID control.
Velocity Control
An example of how to drive a motor smoothly between random speeds, with the help of it's attached encoder and PID control.
Position on Velocity Control
motors/position_on_velocity_control.py
An example of how to move a motor smoothly between random positions, with velocity limits, with the help of it's attached encoder and PID control.
Reactive Encoder
A demonstration of how a motor with an encoder can be used as a programmable rotary encoder for user input, with force-feedback for arbitrary detents and end stops.
Position Wave
A demonstration of driving both of Inventor 2040 W's motor outputs between positions, with the help of their attached encoders and PID control.
Driving Sequence
A demonstration of driving both of Inventor 2040 W's motor outputs through a sequence of velocities, with the help of their attached encoders and PID control.
Motor Tuning
Motor Profiler
motors/tuning/motor_profiler.py
A program that profiles the speed of a motor across its PWM duty cycle range using the attached encoder for feedback.
Position Tuning
motors/tuning/position_tuning.py
A program to aid in the discovery and tuning of motor PID values for position control. It does this by commanding the motor to move repeatedly between two setpoint angles and plots the measured response.
Velocity Tuning
motors/tuning/velocity_tuning.py
A program to aid in the discovery and tuning of motor PID values for velocity control. It does this by commanding the motor to drive repeatedly between two setpoint speeds and plots the measured response.
Position on Velocity Tuning
motors/tuning/position_on_velocity_tuning.py
A program to aid in the discovery and tuning of motor PID values for position on velocity control. It does this by commanding the motor to move repeatedly between two setpoint angles and plots the measured response.
Servo Examples
Single Servo
Demonstrates how to control a single servo on Inventor 2040 W.
Multiple Servos
Demonstrates how to control all of the servos on Inventor 2040 W.
Simple Easing
An example of how to move a servo smoothly between random positions.
Servo Wave
An example of applying a wave pattern to a group of servos and the LEDs.
Calibration
Shows how to configure Inventor 2040 W's servos with different common calibrations, as well as a completely custom one.
Audio Examples
Tone Song
This example shows you how you can use Inventor 2040 W's audio output with a speaker to play different notes and string them together into a bleepy tune.
Motor Song
A fun example of how to change a motor's frequency to have it play a song.