## MPU6050 sensor ![Screenshot](../images/ide/mpumonitor.png) Read values(Ax) from a MPU6050 accelerometer and dump them to the serial port. !!! tip "examples/C/MPU6050_UART_DEMO.c" ```python /* Scan the I2C bus for MPU6050 and send results via UART. */ #include // Include file for I/O operations #define REG_CONTROL 0xF4 #define CMD_TEMP 0x2E #define REG_RESULT_AX 0x3B int main (void) { uint8_t addresses[20], found, res[10]={0,0,0,0,0,0,0,0,0,0},i=0; uint8_t accel_range_commands[] = {0x1B, 0<<3}; uint8_t gyro_range_commands[] = {0x1C, 0<<3}; // gyro range uint8_t power_on_commands[] = {0x6B, 0x00}; // Power on char mystring[10]; i2c_init(); uart_init(38400); for(;;) { found = i2c_scan(&addresses[0]); // i2c scan will store the addresses in `addresses`, and return total found sensors. for(i=0;i