wire.h error

I get the following error message when I complile:

C:\Users\stone_a4gvfk5\Documents\Arduino\libraries\DateTime\DateTime.cpp:15:20: fatal error: wiring.h: No such file or directory

#include <wiring.h>

I have uninstalled completely and then reinstalled.
The DateTime file is not located their but it still thinks is should be for some reason. The Wiring.h is in the llibrary.

I'm just baffled.

I have uninstalled completely and then reinstalled.

Uninstalled and reinstalled what? Uninstalling the IDE does not affect libraries that are in your sketch folder.

What are you trying to compile?

uninstalled all of Arduino ide including library folder, appdata and registry. should have been a clean install from the latest release.

I cut and pasted the code to a new sketch.


#include <RTClib.h>

#include <DateTime.h>
#include <Wiring.h>

#include <Arduino.h>
#include
#include <Dusk2Dawn.h>
//#include "DS3231.h"

const int RELAY_1_A = 2;
const int RELAY_1_B = 3;
int door_opened = 1;
int door_closed = 0;
int sunrise;
int sunset;

DateTime current_day;
DateTime current_time;

RTC_DS3231 rtc;
DateTime now = rtc.now();
//current_day = now.day();

void CloseDoor()
{
//Set one relay one and the other off
//this will extend the actuator
digitalWrite(RELAY_1_B, LOW);
digitalWrite(RELAY_1_A, HIGH);
door_closed = 1;
door_opened = 0;
delay(5000);
digitalWrite(RELAY_1_A, LOW);
}

void OpenDoor ()
{
//Set one relay off and the other on
//this will retract the actuator
digitalWrite(RELAY_1_A, LOW);
digitalWrite(RELAY_1_B, HIGH);
door_opened = 1;
door_closed = 0;
delay(5000);
digitalWrite(RELAY_1_B, LOW);
}

Dusk2Dawn rainstone(32.715, -117.1625, -8);

void setup()
{
// Start the I2C interface
//Wire.begin();
// Start the serial interface
Serial.begin(9600); //set up Serial library at 9600 bps

pinMode(RELAY_1_A, OUTPUT);
pinMode(RELAY_1_B, OUTPUT);
}

void loop()
{
DateTime now = rtc.now();
Serial.println("test");
if (now.day() != current_day) //if this is not the same day then initialize for tomorrow
{
sunrise = rainstone.sunrise(now.year(), now.month(), now.day(), true);
sunset = rainstone.sunset(now.year(), now.month(), now.day(), true);
Serial.println(sunrise);
Serial.println(sunset);

current_day = now.day();
door_opened = 0;
door_closed = 0;
}
else
{
Serial.println("open");
delay(1000);
Serial.println("close");
delay(1000);

int current_time = (now.hour() * 60) + now.minute();

if (current_time > (sunrise + 30))
if (door_opened == 0)
{
OpenDoor();
}
if (current_time > (sunset + 60))
if (door_closed == 0)
{
CloseDoor();
}
unsigned long seconds = 1000L;
unsigned long minutes = seconds * 60;
delay(minutes);
}
}

What folders do you have in the C:\Users\stone_a4gvfk5\Documents\Arduino\libraries\ directory?

Post a link to where you got the library from. Please use the chain links icon on the toolbar to make it clickable. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

I haven't used the toolbar. Where would I find it? Sorry this is my first use of the forum

stanthorp:
I haven't used the toolbar. Where would I find it?

See this screenshot:

if the toolbar is not visible to you then it means you're using a browser that is not compatible with the Arduino forum.

You can always just manually create the forum markdown if you prefer. For example, the markdown to create this link:
http://forum.arduino.cc/
looks like this:

[url=http://forum.arduino.cc/]http://forum.arduino.cc/[/url]

I've got to ask the obvious question.

Your thread title refers to wire.h, in your code you've typed Wiring.h, which is giving you an error. Should you perhaps have typed Wire.h (note the capital W, case is important) which is the standard library for using I2C?

Does replacing

#include <Wiring.h>

With

#include <Wire.h>

help?

Ian

I actually tried them both as well as Arduino.h and Arduino.h

Still waiting for an answer to my request:

pert:
Post a link to where you got the library from. Please use the chain links icon on the toolbar to make it clickable. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

Wire is the library you need, not Wiring. Wire is used to control the two wire interface with the real time clock. Looking at your code, you may get different errors once you resolve why Arduino is not finding RTCLib. Have you installed RTCLib? Are you using an RTC? Which one?

(You may need to #include Time.h and TimeLib.h as well, depending on how you use the real time clock.)

Is this the Dusk2Dawn library that you used:

GitHub - dmkishi/Dusk2Dawn: Minimal Arduino library for time of sunrise and sunset.

Resolved the Wire problem. In DateTime.cpp there was an include for wiring.h. I changed it to Wire.h
Now I have an error "'DateTime' does not name a type"
The DateTime library I am using is off GitHub and written by Hickey. It's 10 years old. If anyone has a pointer to a newer version it may solve my type issue.

Chris, the Dusk2Dawn you mentioned is the one i'm using. It works well. I have an RTC and I'm not having issues with it or the RTCLib library. Thank you

stanthorp:
The DateTime library I am using is off GitHub and written by Hickey.

Why is it so hard for you to post a link to the library? We shouldn't need to go searching all over just to help you. Often there are many different sources for an Arduino library of a given name and there may be differences between them. If you're using a different version than the one I'm looking at then it just causes confusion and wasted time.

stanthorp:
If anyone has a pointer to a newer version it may solve my type issue.

From Arduino Playground - HomePage

This library has been superseded by a newer version that is available here

wiring.h was replaced by arduino.h many years ago. You have an old library. Find a newer one.

MorganS:
wiring.h was replaced by arduino.h many years ago. You have an old library. Find a newer one.

It was a confusion in naming. He needed Wire.h, to run the I2C clock.