Seems you forgot to define BUFFER_LENGTH.
Either like so (123 being an arbitrary number)
#define BUFFER_LENGTH 123
or something like this:
int BUFFER_LENGTH=123;
Hope this helpsĀ 😊
To be honest, I didn't forgot, it's on line 12 of the code provided by tvr4 on page 5 and what I really don't understand is that the code has run on my Heltec, see the pic posted on this page and now when I wanted to implement the Neo it flaws, shoot me why, but I have no idea.
Then I played around with the position of the define or int function but both kept giving error codes, this is what I get with #define BUFFER_LENGTH 64 on line 12;
Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "WiFi LoRa 32(V2), Disabled, 240MHz (WiFi/BT), 921600, None, REGION_EU868, None"
C:\Users\Michi\Documents\Arduino\libraries\MPU6050\MPU6050.cpp: In member function 'int8_t MPU6050::GetCurrentFIFOPacket(uint8_t*, uint8_t)':
C:\Users\Michi\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2763:32: error: 'BUFFER_LENGTH' was not declared in this scope
uint8_t Trash[BUFFER_LENGTH];
^
C:\Users\Michi\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2769:39: error: 'Trash' was not declared in this scope
getFIFOBytes(Trash, (uint8_t)RemoveBytes);
^
exit status 1
Error compiling for board WiFi LoRa 32(V2).
Ā
And this when I switch to int, again on line 12;
Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "WiFi LoRa 32(V2), Disabled, 240MHz (WiFi/BT), 921600, None, REGION_EU868, None"
Heltc32GPSthingy:12:19: error: expected initializer before numeric constant
int BUFFER_LENGTH 64
^
C:\Users\Michi\AppData\Local\Temp\arduino_modified_sketch_395157\Heltc32GPSthingy.ino: In function 'int8_t GetCurrentFIFOPacket(uint8_t*, uint8_t)':
Heltc32GPSthingy:362:15: error: 'BUFFER_LENGTH' was not declared in this scope
uint8_t Trash[BUFFER_LENGTH];
^
Heltc32GPSthingy:368:18: error: 'Trash' was not declared in this scope
mpu.getFIFOBytes(Trash, (uint8_t)RemoveBytes);
^
exit status 1
expected initializer before numeric constant
And I really tried to get a grasp of this C++ programming, read a lot, watched tutorials and tried my best, but I'm not an inch further then copying other ones code, fumbling with it in trail and error and hoping for the best, but I really don't understand a thing of what is happening and I start to think that Arduino is not for me...
Ā
Ā
Ā
Ā
Ā
Ā
Ā
Ā
Ā
This post was modified 4 years ago 2 times by
michaelzen