|
ArdEV3
Use EV3 peripherals from Arduino microcontrollers.
|
#include <EV3Motor.h>
Public Member Functions | |
| void | SetPower (uint8_t power) |
| Set the power of the motor. This writes a PWM signal to the enable pin. | |
| void | SetDirection (MotorDirection direction) |
| Set the direction of the motor. This writes digital signals to the input 1 and 2 pins. | |
| void | StartEncoder () |
| Start tracking the encoder position. | |
| void | StopEncoder () |
| Stop tracking the encoder position. | |
| void | ResetEncoder () |
| Reset the encoder to zero. | |
| void | RunToPosition (uint8_t power, unsigned long position) |
| Set the motor running to the specified position at the specified power. This will complete asynchronously. In most cases, you will want to call ResetEncoder() first. | |
| virtual void | Setup () |
| Initialize the motor. Call this in your global setup function. | |
| virtual void | Loop () |
| Run once per cycle – call this in your global loop function. | |
| Public Member Functions inherited from ev3::_::Peripheral< MotorPortConfig > | |
| Peripheral (MotorPortConfig ports) | |
| Initialize this peripheral from the specified port configuration. | |
| auto | Ports () -> MotorPortConfig const & |
| Get the port configuration for this peripheral. | |
Additional Inherited Members | |
| Protected Attributes inherited from ev3::_::Peripheral< MotorPortConfig > | |
| MotorPortConfig | ports |
A class to drive an EV3 motor. See MotorPortConfig for wiring details.
There are a few boilerplate steps that should be followed:
|
virtual |
Run once per cycle – call this in your global loop function.
Reimplemented from ev3::_::Peripheral< MotorPortConfig >.
|
virtual |
Initialize the motor. Call this in your global setup function.
Reimplemented from ev3::_::Peripheral< MotorPortConfig >.