Skip to content
Browse files

Arduino 1.0 compatible

  • Loading branch information...
1 parent 8e266db commit 862b4ecb738f7098d63d2d19dbc505f59fc5337f @PaintYourDragon PaintYourDragon committed Dec 2, 2011
Showing with 6 additions and 12 deletions.
  1. +6 −12 RTClib.cpp
View
18 RTClib.cpp
@@ -10,15 +10,12 @@
#define SECONDS_FROM_1970_TO_2000 946684800
-#if ARDUINO > 22
-#include <arduino.h>
+#if (ARDUINO >= 100)
+ #include <arduino.h>
+#else
+ #include <WProgram.h>
#endif
-#if ARDUINO <= 22
-#include <WProgram.h>
-#endif
-
-
int i = 0; //The new wire library needs to take an int when you are sending for the zero register
////////////////////////////////////////////////////////////////////////////////
// utility code, some of this could be exposed in the DateTime API if needed
@@ -138,8 +135,7 @@ uint8_t RTC_DS1307::begin(void) {
}
-#if ARDUINO > 22
-
+#if (ARDUINO >= 100)
uint8_t RTC_DS1307::isrunning(void) {
Wire.beginTransmission(DS1307_ADDRESS);
@@ -182,9 +178,7 @@ DateTime RTC_DS1307::now() {
return DateTime (y, m, d, hh, mm, ss);
}
-#endif
-
-#if ARDUINO <= 22
+#else
uint8_t RTC_DS1307::isrunning(void) {
Wire.beginTransmission(DS1307_ADDRESS);

0 comments on commit 862b4ec

Please sign in to comment.
Something went wrong with that request. Please try again.