Invalid Library Error with Servo.h and Intel Galileo

I am running a program to calculate cadence from a hall effect sensor, and would like to send instructions to a servo motor based on that data.

A similar problem was found here: but I could not extract a viable solution from it (I tried renaming the files they specified, but they were not found on my computer).

Right now I have only wired my Galileo to a simple circuit consisting of the hall effect sensor and an LED (the LED has not yet been programmed into the circuit). I also have not yet attached the servo to my circuit. I just wanted to see if the code would upload to my board so that I could test the sensor. This is my first time using a Galileo with my Arduino IDE.

This is my error message:

“Invalid library found in C:\Users\Vivienne\AppData\Local\Arduino15\packages\Intel\hardware\i586\1.6.2+1.0\libraries\Wire: C:\Users\Vivienne\AppData\Local\Arduino15\packages\Intel\hardware\i586\1.6.2+1.0\libraries\Wire”

/*  Adapted by Vivienne Jaehn-Kreibaum
 *  from "Bike better with an LED cadence meter" by jessejwk on Instructables
 *  Source:
 *  Date: March 6, 2016
 *  IGEN 230 Term Project - PerfectGear

#include <Servo.h>

#define ARRAY_SIZE 3  //The number of values to keep in the running average
#define TIMEOUT 1500  //Max time without input

const int magnetSensor = A7;  //Change this for your arduino
const int ledPin = 11;
const int threshold = 60;
const int shiftspeed = 180; // arbitrary value, will need to confirm with testing
bool magnetOn = false;
bool prevMagOn = false;
bool primed = false;
bool arrayEmpty = false;  
float times[ARRAY_SIZE];  //array to hold values for the running average
float startTime = millis();
int rpm = 0;
bool pedaling = false;
Servo myservo;

//add a new value to the array, moving the rest back one space and removing the oldest
void updateTimes(float newValue)
  for(int i = 0; i < ARRAY_SIZE-1; i++)  {
    times[i] = times[i+1];
  times[ARRAY_SIZE-1] = newValue;

//returns an average of the values in the array
int avgArray(float values[])  {
  int total = 0;
  int counted = ARRAY_SIZE;
  for(int i = 0; i < ARRAY_SIZE; i++)  {
    total = total + values[i];
    if(values[i] == 0)

//for debugging
void printValues()  {
  for(int i = 0; i < ARRAY_SIZE - 1; i++)  {
    Serial.print(", ");
  Serial.println(times[ARRAY_SIZE -1]);

//clear the array
void clearTimes()  {  
  for(int i = 0; i < ARRAY_SIZE; i++)
    times[i] = 0;

//check if the array is full
void checkFullArray()  {
  arrayEmpty = true;
  for(int i = 0; i < ARRAY_SIZE; i++)  {
    if(times[i] != 0)
      arrayEmpty = false;

// send instruction to servo to change gears
void changeGears(int curr, int next){
  myservo.write(shiftspeed); // put the necessary speed in here 
void setup()  {
  myservo.attach(9); // attached to pin 9

void loop()  {
  //Read from the hall effect sensor (using analog values, unfortunately)
  int magnetState = analogRead(magnetSensor);
  if(magnetState > threshold)  {
    magnetOn = false;
  else  {
    magnetOn = true;
  if(!magnetOn && prevMagOn)  {
    primed = true;
  if(millis()-startTime > TIMEOUT) {
    pedaling = false;
  if(magnetOn && !prevMagOn && primed)  {  //if magnet passes sensor once
    float currentTime = millis();
    float changeTime = (currentTime - startTime);  //record the time since the last pedal
    startTime = millis();
    if(pedaling)  //if there has been pedaling since the last timeout
      updateTimes(changeTime);  //add the time to the running average array
    primed = false;
    pedaling = true;

  //mostly for debugging, this blinks the built-in LED whenever the magnet passes the sensor
    digitalWrite(ledPin, HIGH);
    digitalWrite(ledPin, LOW);
  prevMagOn = magnetOn;
  float gap = avgArray(times);
  if(arrayEmpty)  {
    rpm = 0;
    rpm = 60000/gap;  //turn millisecond gap value into rpm

Thank you for your help!

What IDE version?

Does 1.6.5r5 work? 1.6.6 and 1.6.7 have a lot of new compile problems.

What IDE version?

Does 1.6.5r5 work? 1.6.6 and 1.6.7 have a lot of new compile problems.

Hi DrAzzy,
I tried both version 1.6.2 and 1.6.7 of the Galileo, as well as versions of the Gen 2 (I don’t know which one I have). Those were the only ones I saw, and I don’t know how to select a specific version as I just clicked “update” when installing the Galileo programs.