I am trying out Platform IO but I am unsure how to configure it correctly. I am trying to build the MahonyIMU.ino example from Paul's github https://github.com/PaulStoffregen/NXPMotionSense.git

I have made only one change to the code adding:

#include "Arduino.h"

. . . to the existing includes so it looks like this:

#include "Arduino.h"
#include <NXPMotionSense.h>
#include <MahonyAHRS.h>
#include <Wire.h>
#include <EEPROM.h>

When I try and build it I get these results in the terminal:

The terminal process terminated with exit code: 1


Terminal will be reused by tasks, press any key to close it.


> Executing task in folder Teensy-PropShield-MahonyIMU: C:\Users\Andy\.platformio\penv\Scripts\platformio. exe run <
Processing teensylc (platform: teensy; board: teensylc; framework: arduino)
-------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boa.../teensylc.html
PLATFORM: Teensy 4.4.0 > Teensy LC
HARDWARE: MKL26Z64 48MHz, 8KB RAM, 62KB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1), framework-arduinoteensy 1.147.0 (1.47)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 91 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <EEPROM> 2.0
|-- <Mahony> 1.1
|-- <NXPMotionSense> 1.0
| |-- <EEPROM> 2.0
| |-- <Wire> 1.0
| |-- <VirtualWire>
|-- <Wire> 1.0
Compiling .pio\build\teensylc\src\main.cpp.o
Compiling .pio\build\teensylc\lib2da\NXPMotionSense\NXPMotio nSense.cpp.o
Compiling .pio\build\teensylc\FrameworkArduino\HardwareSeria l5.cpp.o
Compiling .pio\build\teensylc\FrameworkArduino\HardwareSeria l6.cpp.o
lib\NXPMotionSense\NXPMotionSense.cpp: In member function 'bool NXPMotionSense::begin()':
lib\NXPMotionSense\NXPMotionSense.cpp:40:34: error: '_crc16_update' was not declared in this scope
crc = _crc16_update(crc, buf[i]);
^
lib\NXPMotionSense\NXPMotionSense.cpp: In member function 'bool NXPMotionSense::writeCalibration(const void*)':
lib\NXPMotionSense\NXPMotionSense.cpp:268:32: error: '_crc16_update' was not declared in this scope
crc = _crc16_update(crc, p[i]);
^
*** [.pio\build\teensylc\lib2da\NXPMotionSense\NXPMotio nSense.cpp.o] Error 1
=========================================== [FAILED] Took 14.42 seconds ===========================================



Can anyone offer any guidance?