orhanli1
Junior Member level 1
I use dspic33fj128gp802 and MPU6050 for my project. Microcontroller succesfully takes the data from sensors 6 channel and sends the data pc via UART. When i want to add "float 2.0" or "int 2" to accelerometer data for calibration it stops to send data to uart. I've tried all of data type combinations but it always fails. I only add one line of code to my source code but when i add, the code doesn't send data to PC. I use MikroC pro for dspic. The newly added line is shared below. This added line does not generate any compiling or debugging error.
accel_z = (float) accel_z + 2.0;
As a solution when i change the last line to accel_z = (float) accel_z / 2.0;
it succesfully divides the result to 2. As a summary, dividing operator works well but summing operator does not work.
I cannot find any solution. I am waiting for your considerations.
Thank you.
accel_z = (float) accel_z + 2.0;
As a solution when i change the last line to accel_z = (float) accel_z / 2.0;
it succesfully divides the result to 2. As a summary, dividing operator works well but summing operator does not work.
I cannot find any solution. I am waiting for your considerations.
Thank you.