Here is a list of all examples:
- detect_phase_relation.ino
Example: Connect the encoded motor to the specified positions E0 as described in the example program. After the program runs successfully, it will print out whether kAPhaseLeads or kBPhaseLeads should be used based on the actual phase relationship between the A and B phases of the encoder during forward rotation of the motor, helping the user determine the value that should be set for the phase_relation parameter when creating an EncoderMotor object |
- drive_dc_motor.ino
Example: Use PWM to drive the DC motor to rotate forward and backward |
- forward_stop_backward.ino
Example: Move the motor forward, stop it, and then move it backward |
- run_pwm.ino
Example: Rotate the motor with the specified PWM duty cycle |
- run_rpm_with_analog_input.ino
Example: Dynamically set the rotation speed of the motor according to the analog value of the specific I/O port |
- run_speed.ino
Example: Rotate the motor at the specified speed (RPM) |