I found my old Spark Core and started playing around with it again. I’m trying to build a simple MPU6050 example to get started, but I can’t get it to build using any method.
My code includes MPU6050_6Axis_MotionApps20.h
, and this gives me the following error:
lib/MPU6050/MPU6050.h:411:7: type 'struct MPU6050' violates one definition rule [-Werror=odr]
When Iinclude MPU6050.h
instead, it will build just fine, but I need functions that are defined in MPU6050_6Axis_MotionApps20.h
.
Meanwhile, I tried using the local build methods, but they don’t seem to support the core
at all:
$ particle compile core src/imu.ino lib/MPU6050/src/ --target 1.4.4 --saveTo firmware.bin
Compiling code for core
Targeting version: 1.4.4
Including:
src/imu.ino
lib/MPU6050/src/helper_3dmath.h
lib/MPU6050/src/I2Cdev.h
lib/MPU6050/src/MPU6050_6Axis_MotionApps20.h
lib/MPU6050/src/MPU6050_9Axis_MotionApps41.h
lib/MPU6050/src/MPU6050.h
lib/MPU6050/src/MPU6050/helper_3dmath.h
lib/MPU6050/src/MPU6050/I2Cdev.h
lib/MPU6050/src/MPU6050/MPU6050_6Axis_MotionApps20.h
lib/MPU6050/src/MPU6050/MPU6050_9Axis_MotionApps41.h
lib/MPU6050/src/MPU6050/MPU6050.h
lib/MPU6050/src/I2Cdev.cpp
lib/MPU6050/src/MPU6050.cpp
attempting to compile firmware
Compile failed: Provide platform for compiling
(note that the compilation succeeds if I specify photon
as the target platform.)
And VSCode doesn’t even let me choose core
as my target platform. Am I out of luck because the core
is so old at this point? Are there other options for manually invoking the toolchain? Can I edit the Makefile
somewhere and move forward? All I want to do is use my core
and IMU for a simple test using the MPU6050 libraries for data conversion.