I am getting errors when trying to compile simple examples from Qwiic Distance Sensor tutorials.
For example code
#include <Wire.h>
#include "SparkFun_VL53L1X.h"
//Optional interrupt and shutdown pins.
#define SHUTDOWN_PIN 2
#define INTERRUPT_PIN 3
SFEVL53L1X distanceSensor(Wire, SHUTDOWN_PIN, INTERRUPT_PIN);
void setup(void)
{
Wire.begin();
Serial.begin(9600);
Serial.println("VL53L1X Qwiic Test");
if (distanceSensor.init() == false)
Serial.println("Sensor online!");
}
void loop(void)
{
distanceSensor.startRanging(); //Write configuration bytes to initiate measurement
int distance = distanceSensor.getDistance(); //Get the result of the measurement from the sensor
distanceSensor.stopRanging();
Serial.print("Distance(mm): ");
Serial.print(distance);
float distanceInches = distance * 0.0393701;
float distanceFeet = distanceInches / 12.0;
Serial.print("\tDistance(ft): ");
Serial.print(distanceFeet, 2);
Serial.println();
}
Results in error at linking stage or something like that
sketch\TestDistanceSensor.ino.cpp.o: In function `loop':
C:\Development\Arduino\TestDistance\TestDistanceSensor/TestDistanceSensor.ino:38: undefined reference to `Serial'
sketch\TestDistanceSensor.ino.cpp.o: In function `setup':
C:\Development\Arduino\TestDistance\TestDistanceSensor/TestDistanceSensor.ino:20: undefined reference to `Serial'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board SparkFun RedBoard Turbo.