Hello,
I have a working code to read data from BMI160 an IMU sensor. The data is sent over BLE. Is there any way I can display the int16 data as it is in android or windows PC. Please reply ASAP
Hello,
I have a working code to read data from BMI160 an IMU sensor. The data is sent over BLE. Is there any way I can display the int16 data as it is in android or windows PC. Please reply ASAP
Hey, you can use nrf Connect for Android or for Desktop.
My data is 12 characters long and I have used nRF connect and I am getting the data but in hex format. But I want them to be displayed in real numbers. Also, can you tell me that how ble_uart_nus_string_send service sends a character I mean (LSB first or MSB).
Hey,
Maybe you can put your integer value inside a string and send the string to android device. That way there will be no conversion required.
And I think, the data sent should be MSB first, but I am not sure.
Hey,
Maybe you can put your integer value inside a string and send the string to android device. That way there will be no conversion required.
And I think, the data sent should be MSB first, but I am not sure.
I am doing the same actually. Here is the snippet of the code that converts the data raead from IMU sensor(which is int16 ). to char string.
union {
struct bmi160_sensor_data accel;
uint8_t ch[8];
} accelValue;Here struct bmi160_sensor_data accel; is of the form
struct bmi160_sensor_data {
/*! X-axis sensor data */
int16_t x;
/*! Y-axis sensor data */
int16_t y;
/*! Z-axis sensor data */
int16_t z;
/*! sensor time */
uint32_t sensortime;
};And is there any other way i could convert the integer value into a string.
Maybe, try something like this.
sensor_string = "%d, %d, %d, %d" unsigned char string_to_send[25]; sprintf(string_to_send, sensor_string, x, y, z, sensor_time); ble_uart_nus_string_send(string_to_send, strlen(string_to_send);
would sprintf have any effect on cpu performance?