29 #include <mraa/types.hpp> 30 #include <mraa/i2c.hpp> 32 #define GROVEMD_I2C_BUS 0 33 #define GROVEMD_DEFAULT_I2C_ADDR 0x0f 88 typedef enum { SET_SPEED = 0x82,
93 STEPPER_ENABLE = 0x1a,
94 STEPPER_DISABLE = 0x1b,
95 STEPPER_NUM_STEPS = 0x1c
99 typedef enum { STEP_DIR_CCW = 0x01,
104 typedef enum { DIR_CCW = 0x02,
109 typedef enum { STEP_MODE1 = 0x00,
119 GroveMD(
int bus=GROVEMD_I2C_BUS,
120 uint8_t address=GROVEMD_DEFAULT_I2C_ADDR);
135 bool writePacket(REG_T reg, uint8_t data1, uint8_t data2);
212 void configStepper(
unsigned int stepsPerRev, STEP_MODE_T mode=STEP_MODE1);
222 uint32_t m_stepDelay;
223 uint32_t m_totalSteps;
224 STEP_MODE_T m_stepMode;
236 static const uint8_t GROVEMD_NOOP = 0x01;
238 struct timeval m_startTime;
246 uint32_t getMillis();
bool enableStepper(STEP_DIRECTION_T dir, uint8_t speed)
Definition: grovemd.cxx:109
bool disableStepper()
Definition: grovemd.cxx:152
API for the Grove I2C Motor Driver.
Definition: grovemd.hpp:84
bool setMotorSpeeds(uint8_t speedA, uint8_t speedB)
Definition: grovemd.cxx:93
bool writePacket(REG_T reg, uint8_t data1, uint8_t data2)
Definition: grovemd.cxx:68
bool setPWMFrequencyPrescale(uint8_t freq=0x03)
Definition: grovemd.cxx:98
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
bool setMotorDirections(DC_DIRECTION_T dirA, DC_DIRECTION_T dirB)
Definition: grovemd.cxx:103
void configStepper(unsigned int stepsPerRev, STEP_MODE_T mode=STEP_MODE1)
Definition: grovemd.cxx:215
~GroveMD()
Definition: grovemd.cxx:62
GroveMD(int bus=GROVEMD_I2C_BUS, uint8_t address=GROVEMD_DEFAULT_I2C_ADDR)
Definition: grovemd.cxx:36
bool setStepperSteps(unsigned int steps)
Definition: grovemd.cxx:162