Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
shared/I2CMD/I2CMD.h
- Committer:
- e2011220
- Date:
- 2021-04-14
- Revision:
- 0:ee7e9405e1c7
File content as of revision 0:ee7e9405e1c7:
#ifndef I2CMD_H_
#define I2CMD_H_
#include <mbed.h>
#include <shared/MD/MD.h>
class I2CMD : public MD
{
public:
I2CMD(I2C *i2c_bus, int i2c_address, int motor_id, int retries = 10);
virtual void drive(double);
virtual void brake(double);
virtual void free();
void set_retries(int);
bool get_error();
private:
bool i2c_write(int command, char *data, int length);
uint8_t conv_strength_to_duty_u8(double);
I2C *_i2c_bus;
int _i2c_address;
int _motor_id;
int _retries;
bool _error;
};
#endif