Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added compatiblity for Arduino 1.0

  • Loading branch information...
commit ac68a66584cabef6e0dbccfa2c80745c6ea57c2b 1 parent 4cae57e
@sudar sudar authored
Showing with 23 additions and 6 deletions.
  1. +6 −4 Max3421e.h
  2. +11 −1 Max_LCD.cpp
  3. +6 −1 Max_LCD.h
View
10 Max3421e.h
@@ -3,10 +3,12 @@
#ifndef _MAX3421E_H_
#define _MAX3421E_H_
-
-//#include <Spi.h>
-//#include <WProgram.h>
-#include "WProgram.h"
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+ #include <Arduino.h>
+#else
+ #include <WProgram.h>
+#endif
#include "Max3421e_constants.h"
class MAX3421E /* : public SPI */ {
View
12 Max_LCD.cpp
@@ -7,7 +7,12 @@
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
-#include "WProgram.h"
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+ #include <Arduino.h>
+#else
+ #include <WProgram.h>
+#endif
// When the display powers up, it is configured as follows:
//
@@ -226,7 +231,12 @@ inline void Max_LCD::command(uint8_t value) {
delayMicroseconds(100);
}
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+inline size_t Max_LCD::write(uint8_t value) {
+#else
inline void Max_LCD::write(uint8_t value) {
+#endif
LCD_sendchar(value);
}
View
7 Max_LCD.h
@@ -70,7 +70,12 @@ class Max_LCD : public Print {
void noAutoscroll();
void createChar(uint8_t, uint8_t[]);
void setCursor(uint8_t, uint8_t);
+// Arduino 1.0 compatibility
+#if defined(ARDUINO) && ARDUINO >= 100
+ virtual size_t write(uint8_t);
+#else
virtual void write(uint8_t);
+#endif
void command(uint8_t);
private:
void sendbyte( uint8_t val );
@@ -84,4 +89,4 @@ class Max_LCD : public Print {
-#endif
+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.