53 fd = open(
"/dev/i2c-1", O_RDWR);
55 fprintf(stderr,
"Failed to set slave address: %m\n");
66 fprintf(stderr,
"Failed to write to I2C device. 1\n");
70 fprintf(stderr,
"Failed to write to I2C device. 2\n");
74 fprintf(stderr,
"Failed to write to I2C device. 3\n");
78 fprintf(stderr,
"Failed to write to I2C device. 4\n");
82 fprintf(stderr,
"Failed to write to I2C device. 5\n");
91 unsigned char lsb, msb;
95 int raw_voltage = (lsb >> 6) | (msb << 2);
void bat_voltage_ardrone2_init(void)
void bat_voltage_ardrone2_periodic(void)
Interface for electrical status: supply voltage, current, battery status, etc.
void electrical_ardrone2_setup(void)
static __s32 i2c_smbus_write_byte_data(int file, __u8 command, __u8 value)
static __s32 i2c_smbus_read_byte_data(int file, __u8 command)
uint16_t vsupply
supply voltage in decivolts
struct Electrical electrical