Jump to content
I2Cdevlib Forums

Arduino Sketch to automatically calculate MPU6050 offsets


Recommended Posts

Why i get this ? 

Arduino: 1.8.1 (Windows 10), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"

D:\MPU6050_calibration\MPU6050_calibration.ino: In function 'void setup()':

MPU6050_calibration:62: error: 'TWBR' was not declared in this scope

   TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz). Leonardo measured 250kHz.

   ^

exit status 1
'TWBR' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 

Link to comment
Share on other sites

  • 1 month later...
On 1/31/2014 at 4:12 PM, luisrodenas said:

Fixed!! There was a bug in the sketch.

Variables were overflowing in 8-bit Arduinos, like the UNO or Leonardo.

 

Now it works fine in my Leonardo, but took a while to converge, 2-3 minutes.

 

Thank you for your contribution and let me know if it works for you now.

how did you get this fixed? I am using uno board and it is taking forever. a help will be nice.

Send any character to start sketch.

Send any character to start sketch.


MPU6050 Calibration Sketch

Your MPU6050 should be placed in horizontal position, with package letters facing up. 
Don't touch it until you see a finish message.

MPU6050 connection successful

Reading sensors for first time...

Calculating offsets...
-234    -135    17729    -3    0    -1
102    -52    16091    -5    0    -1
-75    -36    16578    5    -2    -3
0    352    16065    -3    3    -11
-33    24    16581    4    -4    25
-150    -251    16330    -5    6    -30
223    343    16379    2    -6    33
-204    -174    16238    0    1    -32
303    190    16519    -2    1    27
-49    -118    16471    0    0    -23
-125    80    16413    -4    3    27
-73    51    16230    7    0    -34
139    -36    16406    -2    1    38
50    452    16604    0    -4    -38
163    -124    16578    -2    5    38
175    0    16349    6    -1    -41
-306    -179    16161    -7    -4    41
305    182    16530    5    6    -43
-413    -400    16120    -7    -7    50
-118    203    16312    5    12    -50
156    -264    16642    0    -15    47
-235    -107    16077    0    12    -41
50    24    16520    -8    -10    36
-176    -310    16327    10    6    -30
76    506    16280    -5    -2    24
510    261    16770    11    0    -25
68    152    16361    -14    0    18
63    -96    16255    23    -1    -23
-520    -344    16262    -29    3    26
487    544    16904    35    -4    -26
268    -118    16165    -36    8    25
-318    -83    16343    34    -4    -21
-405    -280    16202    -36    -3    23
270    153    16597    33    -2    -31
187    109    16321    -29    5    33
5    -21    16362    24    -1    -29
-459    -326    16217    -30    1    29
196    130    16524    34    0    -25
308    93    16500    -28    -6    17
-210    225    16245    23    12    -16
-97    -108    16423    -14    -8    23
27    -88    16324    6    0    -22
-215    -191    16229    -5    5    19
163    40    16440    7    -3    -16
-42    -23    16342    -6    -1    20
144    462    16583    8    -2    -27
101    -270    16409    -7    2    25
-31    141    16387    12    -5    -18
-174    -79    16374    -23    3    12
-58    38    16192    15    5    -6
 

 

 

these are my readings....

Link to comment
Share on other sites

  • 5 weeks later...
  • 4 weeks later...
On 5/8/2017 at 1:15 AM, ximbax007 said:

I have tried to use the program, but he don´t calculate the offsets. He show the serial, but  stoped and not show anything

I had the same problem.

Make sure you don't have anything else connected to your Arduino and that you haven't connected the ADO pin to your arduino

Link to comment
Share on other sites

  • 3 weeks later...

I'm doing a project with the MPU6050 accelerometer. First I calculate the displacements of the MPU only once executing the sketch of Luis Ródenas,

Later, once I get the displacements, I copy them into the configuration of a second sketch and I always execute it with the same values.

//Placa casa MPU6050 viejo
//-1172  -873  1351  76  -758  27
accelgyro.setXAccelOffset(-1172);
accelgyro.setYAccelOffset(-873);
accelgyro.setZAccelOffset(1351);
accelgyro.setXGyroOffset(76);
accelgyro.setYGyroOffset(-773);
accelgyro.setZGyroOffset(33);

The problem I have is that after a time of having executed the second sketch several times, the raw readings present a new displacement

I read that this problem can be by the temperature of the sensor, that it is necessary to compensate the readings with the temperature. But I can not find an example to do so. I wanted to ask if anyone knows what the problem might be and how I can fix it

Thank you very much

Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...

Hi guys,

First of all, many thanks to luisrodenas for sharing this work! And to all who contributed on the thread along this years.

Studying the code, I have stumbled on a doubt that many here have posted without a definitive answer, which was asked also in many other sources that refers to this calibration code.

What is the motivation for the division by 8 and 4 in the calibration function?
 

  ax_offset=-mean_ax/8;
  ay_offset=-mean_ay/8;
  az_offset=(16384-mean_az)/8;

  gx_offset=-mean_gx/4;
  gy_offset=-mean_gy/4;
  gz_offset=-mean_gz/4;

I have searched a lot but couldn't figure it out. Was it based on trial and error?

Also, when we use the setOffset functions, what those really do in the sensor?

    accelgyro.setXAccelOffset(ax_offset);
    accelgyro.setYAccelOffset(ay_offset);
    accelgyro.setZAccelOffset(az_offset);

    accelgyro.setXGyroOffset(gx_offset);
    accelgyro.setYGyroOffset(gy_offset);
    accelgyro.setZGyroOffset(gz_offset);


For example, if I took the ax_offset, ay_offset, az_offset, gx_offset, gy_offset, and gz_offset values, and subtract from raw data taken from the sensor (without any offset configuration), would that have the same effect? I am looking forward to experiment it myself, but I still don't have access to the resources yet.

Many thanks

Link to comment
Share on other sites

  • 2 months later...

Dear luisrodenas,

May I know what is the motivation for the division by 8 and 4 in the calibration function?

 

  ax_offset=-mean_ax/8;
  ay_offset=-mean_ay/8;
  az_offset=(16384-mean_az)/8;

  gx_offset=-mean_gx/4;
  gy_offset=-mean_gy/4;
  gz_offset=-mean_gz/4;

Moreover in calibration function, unlike accelerometer offset value why the (gyro offset - mean gyro value) is  divided by 2 instead of 1 which is giro_deadzone?

    if (abs(mean_gx)<=giro_deadzone) ready++;
    else gx_offset=gx_offset-mean_gx/(giro_deadzone+1);

    if (abs(mean_gy)<=giro_deadzone) ready++;
    else gy_offset=gy_offset-mean_gy/(giro_deadzone+1);

    if (abs(mean_gz)<=giro_deadzone) ready++;
    else gz_offset=gz_offset-mean_gz/(giro_deadzone+1);

I would be really thankful if I get the reasons of using different divisor value.

Thank you.

Link to comment
Share on other sites

Dear luisrodenas,

May I know what is the motivation for the division by 8 and 4 in the calibration function?

 

  ax_offset=-mean_ax/8;
  ay_offset=-mean_ay/8;
  az_offset=(16384-mean_az)/8;

  gx_offset=-mean_gx/4;
  gy_offset=-mean_gy/4;
  gz_offset=-mean_gz/4;

Moreover in calibration function, unlike accelerometer offset value why the (gyro offset - mean gyro value) is divided by 2 instead of 1 which is giro_deadzone?

    if (abs(mean_gx)<=giro_deadzone) ready++;
    else gx_offset=gx_offset-mean_gx/(giro_deadzone+1);

    if (abs(mean_gy)<=giro_deadzone) ready++;
    else gy_offset=gy_offset-mean_gy/(giro_deadzone+1);

    if (abs(mean_gz)<=giro_deadzone) ready++;
    else gz_offset=gz_offset-mean_gz/(giro_deadzone+1);

I would be really thankful if I get the reasons for using different divisor value.

Thank you.

Link to comment
Share on other sites

  • 9 months later...

Dear Susanrenrr3jrlin and anyone who might be confused about these calculations on the calibration function:

On 3/29/2018 at 8:49 PM, renrr3 said:

Studying the code, I have stumbled on a doubt that many here have posted without a definitive answer, which was asked also in many other sources that refers to this calibration code.

What is the motivation for the division by 8 and 4 in the calibration function?

 

On 6/14/2018 at 9:35 AM, Susan said:

May I know what is the motivation for the division by 8 and 4 in the calibration function?

 

On 6/14/2018 at 9:35 AM, Susan said:

ax_offset=-mean_ax/8;

ay_offset=-mean_ay/8;

az_offset=(16384-mean_az)/8;

gx_offset=-mean_gx/4;

gy_offset=-mean_gy/4;

gz_offset=-mean_gz/4;

     I came upon this problem while trying to calibrate the sensor with a +/-16G range. It turns out that these constants rescale the offsets for the selected sensibility, as the values returned by the MPU6050 are in the maximum range. So, for a +/-2G accelerometer range (standard) it's necessary to divide the coefficients by 8 (16G/8 = 2G) and the gyroscope ones by 4 for a standard sensibility of 250dps (1000dps/4 = 250dps). In order to calibrate the sensor properly, I also had to change the constants 16384 by 2048. This is because the chip provides values between -32,768 and 32,767. With a range of 2G, the gravity acceleration is equivalent to the number 16384 (32767/2). If the range is 16G, then 1G is 2048 (32767/16).

  This explanation was provided by arduarn in the Arduino forum. You can check the original discussion here http://forum.arduino.cc/index.php?topic=535717

  Best wishes,

 

Link to comment
Share on other sites

  • 4 years later...

I always find error message when I upload the codes from 

MPU6050_DMP6.
 
The Error message as follows:

C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:18: error: variable or field 'serialEvent' declared void
 void serialEvent(Serial port) {
                  ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:25: error: expected ')' before 'port'
 void serialEvent(Serial port) {
                         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:32:1: error: 'import' does not name a type; did you mean 'qsort'?
 import processing.serial.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:33:1: error: 'import' does not name a type; did you mean 'qsort'?
 import processing.opengl.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:34:1: error: 'import' does not name a type; did you mean 'qsort'?
 import toxi.geom.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:35:1: error: 'import' does not name a type; did you mean 'qsort'?
 import toxi.processing.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:43:1: error: 'ToxiclibsSupport' does not name a type
 ToxiclibsSupport gfx;
 ^~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:45:1: error: 'Serial' does not name a type
 Serial port;                         // The serial port
 ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: error: decomposition declaration cannot be declared with type 'char'
 char[] teapotPacket = new char[14];  // InvenSense Teapot packet
     ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:8: error: expected initializer before 'teapotPacket'
 char[] teapotPacket = new char[14];  // InvenSense Teapot packet
        ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: error: decomposition declaration cannot be declared with type 'float'
 float[] q = new float[4];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:9: error: expected initializer before 'q'
 float[] q = new float[4];
         ^
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:52:19: error: conversion from 'Quaternion*' to non-scalar type 'Quaternion' requested
 Quaternion quat = new Quaternion(1, 0, 0, 0);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: error: decomposition declaration cannot be declared with type 'float'
 float[] gravity = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:9: error: expected initializer before 'gravity'
 float[] gravity = new float[3];
         ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: error: decomposition declaration cannot be declared with type 'float'
 float[] euler = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:9: error: expected initializer before 'euler'
 float[] euler = new float[3];
         ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: error: decomposition declaration cannot be declared with type 'float'
 float[] ypr = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:9: error: expected initializer before 'ypr'
 float[] ypr = new float[3];
         ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void setup()':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:58:6: error: redefinition of 'void setup()'
 void setup() {
      ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPU6050_DMP6.ino:165:6: note: 'void setup()' previously defined here
 void setup() {
      ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:20: error: 'OPENGL' was not declared in this scope
     size(300, 300, OPENGL);
                    ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:5: error: 'size' was not declared in this scope
     size(300, 300, OPENGL);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:5: note: suggested alternative: 'Wire'
     size(300, 300, OPENGL);
     ^~~~
     Wire
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:61:5: error: 'gfx' was not declared in this scope
     gfx = new ToxiclibsSupport(this);
     ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:61:15: error: expected type-specifier before 'ToxiclibsSupport'
     gfx = new ToxiclibsSupport(this);
               ^~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:64:5: error: 'lights' was not declared in this scope
     lights();
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:64:5: note: suggested alternative: 'gets'
     lights();
     ^~~~~~
     gets
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:65:5: error: 'smooth' was not declared in this scope
     smooth();
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:65:5: note: suggested alternative: 'short'
     smooth();
     ^~~~~~
     short
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:20: error: 'class HardwareSerial' has no member named 'list'
     println(Serial.list());
                    ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:5: error: 'println' was not declared in this scope
     println(Serial.list());
     ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:5: note: suggested alternative: 'printf'
     println(Serial.list());
     ^~~~~~~
     printf
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:71:30: error: 'class HardwareSerial' has no member named 'list'
     String portName = Serial.list()[0];
                              ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:5: error: 'port' was not declared in this scope
     port = new Serial(this, portName, 115200);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:5: note: suggested alternative: 'word'
     port = new Serial(this, portName, 115200);
     ^~~~
     word
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:16: error: expected type-specifier before 'Serial'
     port = new Serial(this, portName, 115200);
                ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void draw()':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:88:9: error: 'port' was not declared in this scope
         port.write('r');
         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:88:9: note: suggested alternative: 'word'
         port.write('r');
         ^~~~
         word
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:93:5: error: 'background' was not declared in this scope
     background(0);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:93:5: note: suggested alternative: 'round'
     background(0);
     ^~~~~~~~~~
     round
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:96:5: error: 'pushMatrix' was not declared in this scope
     pushMatrix();
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:15: error: 'width' was not declared in this scope
     translate(width / 2, height / 2);
               ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:26: error: 'height' was not declared in this scope
     translate(width / 2, height / 2);
                          ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:5: error: 'translate' was not declared in this scope
     translate(width / 2, height / 2);
     ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: error: decomposition declaration cannot be declared with type 'float'
     float[] axis = quat.toAxisAngle();
          ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:13: error: expected initializer before 'axis'
     float[] axis = quat.toAxisAngle();
             ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:12: error: 'axis' was not declared in this scope
     rotate(axis[0], -axis[1], axis[3], axis[2]);
            ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:12: note: suggested alternative: 'exit'
     rotate(axis[0], -axis[1], axis[3], axis[2]);
            ^~~~
            exit
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:5: error: 'rotate' was not declared in this scope
     rotate(axis[0], -axis[1], axis[3], axis[2]);
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:5: note: suggested alternative: 'rename'
     rotate(axis[0], -axis[1], axis[3], axis[2]);
     ^~~~~~
     rename
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:113:5: error: 'fill' was not declared in this scope
     fill(255, 0, 0, 200);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:113:5: note: suggested alternative: 'ftell'
     fill(255, 0, 0, 200);
     ^~~~
     ftell
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:114:5: error: 'box' was not declared in this scope
     box(10, 10, 200);
     ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:120:5: error: 'rotateX' was not declared in this scope
     rotateX(PI/2);
     ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:122:5: error: 'popMatrix' was not declared in this scope
     popMatrix();
     ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:16: error: 'TRIANGLES' was not declared in this scope
     beginShape(TRIANGLES);
                ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:5: error: 'beginShape' was not declared in this scope
     beginShape(TRIANGLES);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:5: note: suggested alternative: 'blinkState'
     beginShape(TRIANGLES);
     ^~~~~~~~~~
     blinkState
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:127:5: error: 'vertex' was not declared in this scope
     vertex(-100,  2, 30); vertex(0,  2, -80); vertex(100,  2, 30);  // wing top layer
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:131:5: error: 'endShape' was not declared in this scope
     endShape();
     ^~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:132:16: error: 'QUADS' was not declared in this scope
     beginShape(QUADS);
                ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: At global scope:
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:18: error: variable or field 'serialEvent' declared void
 void serialEvent(Serial port) {
                  ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:25: error: expected ')' before 'port'
 void serialEvent(Serial port) {
                         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void drawCylinder(float, float, float, int)':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:16: error: 'QUAD_STRIP' was not declared in this scope
     beginShape(QUAD_STRIP);
                ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:5: error: 'beginShape' was not declared in this scope
     beginShape(QUAD_STRIP);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:5: note: suggested alternative: 'blinkState'
     beginShape(QUAD_STRIP);
     ^~~~~~~~~~
     blinkState
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:209:9: error: 'vertex' was not declared in this scope
         vertex(topRadius*cos(angle), 0, topRadius*sin(angle));
         ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:213:5: error: 'endShape' was not declared in this scope
     endShape();
     ^~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:218:20: error: 'TRIANGLE_FAN' was not declared in this scope
         beginShape(TRIANGLE_FAN);
                    ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:221:9: error: 'vertex' was not declared in this scope
         vertex(0, 0, 0);
         ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:232:20: error: 'TRIANGLE_FAN' was not declared in this scope
         beginShape(TRIANGLE_FAN);
                    ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:235:9: error: 'vertex' was not declared in this scope
         vertex(0, tall, 0);
         ^~~~~~

exit status 1

Compilation error: variable or field 'serialEvent' declared void

Link to comment
Share on other sites

  • 7 months later...
On 6/24/2023 at 10:41 AM, hasanmdmahmudul5 said:

I always find error message when I upload the codes from 

MPU6050_DMP6.
 
The Error message as follows:

C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:18: error: variable or field 'serialEvent' declared void
 void serialEvent(Serial port) {
                  ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:25: error: expected ')' before 'port'
 void serialEvent(Serial port) {
                         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:32:1: error: 'import' does not name a type; did you mean 'qsort'?
 import processing.serial.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:33:1: error: 'import' does not name a type; did you mean 'qsort'?
 import processing.opengl.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:34:1: error: 'import' does not name a type; did you mean 'qsort'?
 import toxi.geom.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:35:1: error: 'import' does not name a type; did you mean 'qsort'?
 import toxi.processing.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:43:1: error: 'ToxiclibsSupport' does not name a type
 ToxiclibsSupport gfx;
 ^~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:45:1: error: 'Serial' does not name a type
 Serial port;                         // The serial port
 ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: error: decomposition declaration cannot be declared with type 'char'
 char[] teapotPacket = new char[14];  // InvenSense Teapot packet
     ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:8: error: expected initializer before 'teapotPacket'
 char[] teapotPacket = new char[14];  // InvenSense Teapot packet
        ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: error: decomposition declaration cannot be declared with type 'float'
 float[] q = new float[4];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:9: error: expected initializer before 'q'
 float[] q = new float[4];
         ^
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:52:19: error: conversion from 'Quaternion*' to non-scalar type 'Quaternion' requested
 Quaternion quat = new Quaternion(1, 0, 0, 0);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: error: decomposition declaration cannot be declared with type 'float'
 float[] gravity = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:9: error: expected initializer before 'gravity'
 float[] gravity = new float[3];
         ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: error: decomposition declaration cannot be declared with type 'float'
 float[] euler = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:9: error: expected initializer before 'euler'
 float[] euler = new float[3];
         ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: error: decomposition declaration cannot be declared with type 'float'
 float[] ypr = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:9: error: expected initializer before 'ypr'
 float[] ypr = new float[3];
         ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void setup()':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:58:6: error: redefinition of 'void setup()'
 void setup() {
      ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPU6050_DMP6.ino:165:6: note: 'void setup()' previously defined here
 void setup() {
      ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:20: error: 'OPENGL' was not declared in this scope
     size(300, 300, OPENGL);
                    ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:5: error: 'size' was not declared in this scope
     size(300, 300, OPENGL);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:5: note: suggested alternative: 'Wire'
     size(300, 300, OPENGL);
     ^~~~
     Wire
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:61:5: error: 'gfx' was not declared in this scope
     gfx = new ToxiclibsSupport(this);
     ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:61:15: error: expected type-specifier before 'ToxiclibsSupport'
     gfx = new ToxiclibsSupport(this);
               ^~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:64:5: error: 'lights' was not declared in this scope
     lights();
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:64:5: note: suggested alternative: 'gets'
     lights();
     ^~~~~~
     gets
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:65:5: error: 'smooth' was not declared in this scope
     smooth();
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:65:5: note: suggested alternative: 'short'
     smooth();
     ^~~~~~
     short
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:20: error: 'class HardwareSerial' has no member named 'list'
     println(Serial.list());
                    ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:5: error: 'println' was not declared in this scope
     println(Serial.list());
     ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:5: note: suggested alternative: 'printf'
     println(Serial.list());
     ^~~~~~~
     printf
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:71:30: error: 'class HardwareSerial' has no member named 'list'
     String portName = Serial.list()[0];
                              ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:5: error: 'port' was not declared in this scope
     port = new Serial(this, portName, 115200);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:5: note: suggested alternative: 'word'
     port = new Serial(this, portName, 115200);
     ^~~~
     word
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:16: error: expected type-specifier before 'Serial'
     port = new Serial(this, portName, 115200);
                ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void draw()':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:88:9: error: 'port' was not declared in this scope
         port.write('r');
         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:88:9: note: suggested alternative: 'word'
         port.write('r');
         ^~~~
         word
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:93:5: error: 'background' was not declared in this scope
     background(0);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:93:5: note: suggested alternative: 'round'
     background(0);
     ^~~~~~~~~~
     round
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:96:5: error: 'pushMatrix' was not declared in this scope
     pushMatrix();
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:15: error: 'width' was not declared in this scope
     translate(width / 2, height / 2);
               ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:26: error: 'height' was not declared in this scope
     translate(width / 2, height / 2);
                          ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:5: error: 'translate' was not declared in this scope
     translate(width / 2, height / 2);
     ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: error: decomposition declaration cannot be declared with type 'float'
     float[] axis = quat.toAxisAngle();
          ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:13: error: expected initializer before 'axis'
     float[] axis = quat.toAxisAngle();
             ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:12: error: 'axis' was not declared in this scope
     rotate(axis[0], -axis[1], axis[3], axis[2]);
            ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:12: note: suggested alternative: 'exit'
     rotate(axis[0], -axis[1], axis[3], axis[2]);
            ^~~~
            exit
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:5: error: 'rotate' was not declared in this scope
     rotate(axis[0], -axis[1], axis[3], axis[2]);
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:5: note: suggested alternative: 'rename'
     rotate(axis[0], -axis[1], axis[3], axis[2]);
     ^~~~~~
     rename
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:113:5: error: 'fill' was not declared in this scope
     fill(255, 0, 0, 200);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:113:5: note: suggested alternative: 'ftell'
     fill(255, 0, 0, 200);
     ^~~~
     ftell
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:114:5: error: 'box' was not declared in this scope
     box(10, 10, 200);
     ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:120:5: error: 'rotateX' was not declared in this scope
     rotateX(PI/2);
     ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:122:5: error: 'popMatrix' was not declared in this scope
     popMatrix();
     ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:16: error: 'TRIANGLES' was not declared in this scope
     beginShape(TRIANGLES);
                ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:5: error: 'beginShape' was not declared in this scope
     beginShape(TRIANGLES);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:5: note: suggested alternative: 'blinkState'
     beginShape(TRIANGLES);
     ^~~~~~~~~~
     blinkState
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:127:5: error: 'vertex' was not declared in this scope
     vertex(-100,  2, 30); vertex(0,  2, -80); vertex(100,  2, 30);  // wing top layer
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:131:5: error: 'endShape' was not declared in this scope
     endShape();
     ^~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:132:16: error: 'QUADS' was not declared in this scope
     beginShape(QUADS);
                ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: At global scope:
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:18: error: variable or field 'serialEvent' declared void
 void serialEvent(Serial port) {
                  ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:25: error: expected ')' before 'port'
 void serialEvent(Serial port) {
                         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void drawCylinder(float, float, float, int)':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:16: error: 'QUAD_STRIP' was not declared in this scope
     beginShape(QUAD_STRIP);
                ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:5: error: 'beginShape' was not declared in this scope
     beginShape(QUAD_STRIP);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:5: note: suggested alternative: 'blinkState'
     beginShape(QUAD_STRIP);
     ^~~~~~~~~~
     blinkState
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:209:9: error: 'vertex' was not declared in this scope
         vertex(topRadius*cos(angle), 0, topRadius*sin(angle));
         ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:213:5: error: 'endShape' was not declared in this scope
     endShape();
     ^~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:218:20: error: 'TRIANGLE_FAN' was not declared in this scope
         beginShape(TRIANGLE_FAN);
                    ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:221:9: error: 'vertex' was not declared in this scope
         vertex(0, 0, 0);
         ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:232:20: error: 'TRIANGLE_FAN' was not declared in this scope
         beginShape(TRIANGLE_FAN);
                    ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:235:9: error: 'vertex' was not declared in this scope
         vertex(0, tall, 0);
         ^~~~~~

exit status 1

Compilation error: variable or field 'serialEvent' declared void

  

On 6/24/2023 at 10:41 AM, hasanmdmahmudul5 said:

I always find error message when I upload the codes from 

MPU6050_DMP6.
 
The Error message as follows:

C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:18: error: variable or field 'serialEvent' declared void
 void serialEvent(Serial port) {
                  ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:25: error: expected ')' before 'port'
 void serialEvent(Serial port) {
                         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:32:1: error: 'import' does not name a type; did you mean 'qsort'?
 import processing.serial.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:33:1: error: 'import' does not name a type; did you mean 'qsort'?
 import processing.opengl.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:34:1: error: 'import' does not name a type; did you mean 'qsort'?
 import toxi.geom.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:35:1: error: 'import' does not name a type; did you mean 'qsort'?
 import toxi.processing.*;
 ^~~~~~
 qsort
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:43:1: error: 'ToxiclibsSupport' does not name a type
 ToxiclibsSupport gfx;
 ^~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:45:1: error: 'Serial' does not name a type
 Serial port;                         // The serial port
 ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: error: decomposition declaration cannot be declared with type 'char'
 char[] teapotPacket = new char[14];  // InvenSense Teapot packet
     ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:5: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:46:8: error: expected initializer before 'teapotPacket'
 char[] teapotPacket = new char[14];  // InvenSense Teapot packet
        ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: error: decomposition declaration cannot be declared with type 'float'
 float[] q = new float[4];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:51:9: error: expected initializer before 'q'
 float[] q = new float[4];
         ^
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:52:19: error: conversion from 'Quaternion*' to non-scalar type 'Quaternion' requested
 Quaternion quat = new Quaternion(1, 0, 0, 0);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: error: decomposition declaration cannot be declared with type 'float'
 float[] gravity = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:54:9: error: expected initializer before 'gravity'
 float[] gravity = new float[3];
         ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: error: decomposition declaration cannot be declared with type 'float'
 float[] euler = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:55:9: error: expected initializer before 'euler'
 float[] euler = new float[3];
         ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: error: decomposition declaration cannot be declared with type 'float'
 float[] ypr = new float[3];
      ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:6: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:56:9: error: expected initializer before 'ypr'
 float[] ypr = new float[3];
         ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void setup()':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:58:6: error: redefinition of 'void setup()'
 void setup() {
      ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPU6050_DMP6.ino:165:6: note: 'void setup()' previously defined here
 void setup() {
      ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:20: error: 'OPENGL' was not declared in this scope
     size(300, 300, OPENGL);
                    ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:5: error: 'size' was not declared in this scope
     size(300, 300, OPENGL);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:60:5: note: suggested alternative: 'Wire'
     size(300, 300, OPENGL);
     ^~~~
     Wire
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:61:5: error: 'gfx' was not declared in this scope
     gfx = new ToxiclibsSupport(this);
     ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:61:15: error: expected type-specifier before 'ToxiclibsSupport'
     gfx = new ToxiclibsSupport(this);
               ^~~~~~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:64:5: error: 'lights' was not declared in this scope
     lights();
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:64:5: note: suggested alternative: 'gets'
     lights();
     ^~~~~~
     gets
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:65:5: error: 'smooth' was not declared in this scope
     smooth();
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:65:5: note: suggested alternative: 'short'
     smooth();
     ^~~~~~
     short
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:20: error: 'class HardwareSerial' has no member named 'list'
     println(Serial.list());
                    ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:5: error: 'println' was not declared in this scope
     println(Serial.list());
     ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:68:5: note: suggested alternative: 'printf'
     println(Serial.list());
     ^~~~~~~
     printf
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:71:30: error: 'class HardwareSerial' has no member named 'list'
     String portName = Serial.list()[0];
                              ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:5: error: 'port' was not declared in this scope
     port = new Serial(this, portName, 115200);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:5: note: suggested alternative: 'word'
     port = new Serial(this, portName, 115200);
     ^~~~
     word
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:77:16: error: expected type-specifier before 'Serial'
     port = new Serial(this, portName, 115200);
                ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void draw()':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:88:9: error: 'port' was not declared in this scope
         port.write('r');
         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:88:9: note: suggested alternative: 'word'
         port.write('r');
         ^~~~
         word
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:93:5: error: 'background' was not declared in this scope
     background(0);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:93:5: note: suggested alternative: 'round'
     background(0);
     ^~~~~~~~~~
     round
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:96:5: error: 'pushMatrix' was not declared in this scope
     pushMatrix();
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:15: error: 'width' was not declared in this scope
     translate(width / 2, height / 2);
               ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:26: error: 'height' was not declared in this scope
     translate(width / 2, height / 2);
                          ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:97:5: error: 'translate' was not declared in this scope
     translate(width / 2, height / 2);
     ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: error: decomposition declaration cannot be declared with type 'float'
     float[] axis = quat.toAxisAngle();
          ^~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:10: error: empty decomposition declaration
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:109:13: error: expected initializer before 'axis'
     float[] axis = quat.toAxisAngle();
             ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:12: error: 'axis' was not declared in this scope
     rotate(axis[0], -axis[1], axis[3], axis[2]);
            ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:12: note: suggested alternative: 'exit'
     rotate(axis[0], -axis[1], axis[3], axis[2]);
            ^~~~
            exit
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:5: error: 'rotate' was not declared in this scope
     rotate(axis[0], -axis[1], axis[3], axis[2]);
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:110:5: note: suggested alternative: 'rename'
     rotate(axis[0], -axis[1], axis[3], axis[2]);
     ^~~~~~
     rename
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:113:5: error: 'fill' was not declared in this scope
     fill(255, 0, 0, 200);
     ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:113:5: note: suggested alternative: 'ftell'
     fill(255, 0, 0, 200);
     ^~~~
     ftell
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:114:5: error: 'box' was not declared in this scope
     box(10, 10, 200);
     ^~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:120:5: error: 'rotateX' was not declared in this scope
     rotateX(PI/2);
     ^~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:122:5: error: 'popMatrix' was not declared in this scope
     popMatrix();
     ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:16: error: 'TRIANGLES' was not declared in this scope
     beginShape(TRIANGLES);
                ^~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:5: error: 'beginShape' was not declared in this scope
     beginShape(TRIANGLES);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:126:5: note: suggested alternative: 'blinkState'
     beginShape(TRIANGLES);
     ^~~~~~~~~~
     blinkState
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:127:5: error: 'vertex' was not declared in this scope
     vertex(-100,  2, 30); vertex(0,  2, -80); vertex(100,  2, 30);  // wing top layer
     ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:131:5: error: 'endShape' was not declared in this scope
     endShape();
     ^~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:132:16: error: 'QUADS' was not declared in this scope
     beginShape(QUADS);
                ^~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: At global scope:
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:18: error: variable or field 'serialEvent' declared void
 void serialEvent(Serial port) {
                  ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:144:25: error: expected ')' before 'port'
 void serialEvent(Serial port) {
                         ^~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde: In function 'void drawCylinder(float, float, float, int)':
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:16: error: 'QUAD_STRIP' was not declared in this scope
     beginShape(QUAD_STRIP);
                ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:5: error: 'beginShape' was not declared in this scope
     beginShape(QUAD_STRIP);
     ^~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:207:5: note: suggested alternative: 'blinkState'
     beginShape(QUAD_STRIP);
     ^~~~~~~~~~
     blinkState
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:209:9: error: 'vertex' was not declared in this scope
         vertex(topRadius*cos(angle), 0, topRadius*sin(angle));
         ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:213:5: error: 'endShape' was not declared in this scope
     endShape();
     ^~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:218:20: error: 'TRIANGLE_FAN' was not declared in this scope
         beginShape(TRIANGLE_FAN);
                    ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:221:9: error: 'vertex' was not declared in this scope
         vertex(0, 0, 0);
         ^~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:232:20: error: 'TRIANGLE_FAN' was not declared in this scope
         beginShape(TRIANGLE_FAN);
                    ^~~~~~~~~~~~
C:\Users\steth\AppData\Local\Temp\.arduinoIDE-unsaved2023524-8068-1i5wnfp.nzl9\MPU6050_DMP6\MPUTeapot.pde:235:9: error: 'vertex' was not declared in this scope
         vertex(0, tall, 0);
         ^~~~~~

exit status 1

Compilation error: variable or field 'serialEvent' declared void

Have you tried deleting the processing file in the mpu6050 library under the MPU6050_DMP6 example folder? Deleting the pde file helped mine

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...