1 Reply Latest reply on Apr 20, 2014 1:54 PM by rmm200

    Missing Wire.h file in the arduino 1.5.3

    mgbv

      Hi,

         I am writing a simple example for servos using the Servo package. When uploading the sketch to Galileo, compilation fails with an error

       

      In file included from servo.ino:1:0:

      /arduino-1.5.3/hardware/arduino/x86/libraries/Servo/Servo.h:5:18: fatal error: Wire.h: No such file or directory

      compilation terminated.

       

      The example being attempted is shared below and is based on http://ardx.org/CIRC04

       

      #include <Servo.h>

      Servo servo1;

      void setup() {

        // put your setup code here, to run once:

        servo1.attach(9);

      }

       

      void loop() {

        // put your main code here, to run repeatedly:

        for(pos=0;pos<180;pos +=1) {

          servo1.write(pos);

          delay(15);

        }

       

        for(pos=180;pos>0;pos -= 1) {

          servo1.write(pos);

          delay(15);

        }

      }

       

      Thanks

       

      Mukesh

        • 1. Re: Missing Wire.h file in the arduino 1.5.3
          rmm200

          The path to Wire.h in Arduino 1.53 is:

           

          arduino-1.5.3\hardware\arduino\x86\libraries\Wire\Wire.h. Wire.cpp lives there too.

           

          To fix it include Wire.h in your sketch: #include <Wire.h>

           

          Bonus fix: You don't define pos for your for statements. Make two changes like:  for(int pos=0;pos<180;pos +=1),

          or define int pos somewhere else.