diff -rupN ./examples/U8gLogo/logo.cpp ../1.16_modified/examples/U8gLogo/logo.cpp
--- ./examples/U8gLogo/logo.cpp	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/examples/U8gLogo/logo.cpp	2014-10-06 21:44:53.768119373 -0600
@@ -0,0 +1,78 @@
+#include <unistd.h>
+#include <U8glib.h>
+
+U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);
+
+void drawColorBox(void)
+{
+  u8g_uint_t w,h;
+  u8g_uint_t r, g, b;
+
+  w = u8g.getWidth()/32;
+  h = u8g.getHeight()/8;
+  for( b = 0; b < 4; b++ )
+    for( g = 0; g < 8; g++ )
+      for( r = 0; r < 8; r++ )
+      {
+        u8g.setColorIndex((r<<5) |  (g<<2) | b );
+        u8g.drawBox(g*w + b*w*8, r*h, w, h);
+      }
+}
+
+void drawLogo(uint8_t d)
+{
+  u8g.setFont(u8g_font_gdr25r);
+  u8g.drawStr(0+d, 30+d, "U");
+  u8g.setFont(u8g_font_gdr30n);
+  u8g.drawStr90(23+d,10+d,"8");
+  u8g.setFont(u8g_font_gdr25r);
+  u8g.drawStr(53+d,30+d,"g");
+
+  u8g.drawHLine(2+d, 35+d, 47);
+  u8g.drawVLine(45+d, 32+d, 12);
+}
+
+void drawURL(void)
+{
+  u8g.setFont(u8g_font_4x6);
+  if ( u8g.getHeight() < 59 )
+  {
+    u8g.drawStr(53,9,"code.google.com");
+    u8g.drawStr(77,18,"/p/u8glib");
+  }
+  else
+  {
+    u8g.drawStr(1,54,"code.google.com/p/u8glib");
+  }
+}
+
+
+void draw(void) {
+  if ( u8g.getMode() == U8G_MODE_R3G3B2 ) {
+    drawColorBox();
+  }
+  u8g.setColorIndex(1);
+  if ( U8G_MODE_GET_BITS_PER_PIXEL(u8g.getMode()) > 1 ) {
+    drawLogo(2);
+    u8g.setColorIndex(2);
+    drawLogo(1);
+    u8g.setColorIndex(3);
+  }
+  drawLogo(0);
+  drawURL();
+
+}
+
+int main(void) {
+  printf("begin logo\r\n");
+  while(true) {
+    u8g.firstPage();
+    do {
+      draw();
+    u8g.setColorIndex(1);
+    } while( u8g.nextPage() );
+
+    usleep(10*1000);
+  }
+  return 0;
+}
diff -rupN ./examples/U8gLogo/Makefile ../1.16_modified/examples/U8gLogo/Makefile
--- ./examples/U8gLogo/Makefile	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/examples/U8gLogo/Makefile	2014-10-06 21:45:40.197557973 -0600
@@ -0,0 +1,18 @@
+PROGRAMS = logo
+SOURCES = ${PROGRAMS:=.cpp}
+
+CC=g++
+INCLUDE=/opt/U8glib/include
+LIBRARY=/usr/lib
+LIBS=-lwiringPi -lU8glib
+
+PREPROCESSOR=-DU8G_RASPBERRY_PI
+CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
+
+all: ${PROGRAMS}
+
+${PROGRAMS}: ${SOURCES}
+	${CC} ${PREPROCESSOR} ${CCFLAGS} -Wall -I${INCLUDE} -L${LIBRARY} $@.cpp -o $@ ${LIBS}
+
+clean:
+	rm $(PROGRAMS)
diff -rupN ./include/Printable.h ../1.16_modified/include/Printable.h
--- ./include/Printable.h	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/include/Printable.h	2014-10-06 21:43:49.908891663 -0600
@@ -0,0 +1,40 @@
+/*
+  Printable.h - Interface class that allows printing of complex types
+  Copyright (c) 2011 Adrian McEwen.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef Printable_h
+#define Printable_h
+
+#include <stdlib.h>
+
+class Print;
+
+/** The Printable class provides a way for new classes to allow themselves to be printed.
+    By deriving from Printable and implementing the printTo method, it will then be possible
+    for users to print out instances of this class by passing them into the usual
+    Print::print and Print::println methods.
+*/
+
+class Printable
+{
+  public:
+    virtual size_t printTo(Print& p) const = 0;
+};
+
+#endif
+
diff -rupN ./include/Print.h ../1.16_modified/include/Print.h
--- ./include/Print.h	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/include/Print.h	2014-10-06 21:43:49.898891784 -0600
@@ -0,0 +1,85 @@
+/*
+  Print.h - Base class that provides print() and println()
+  Copyright (c) 2008 David A. Mellis.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef Print_h
+#define Print_h
+
+#include <inttypes.h>
+#include <stdio.h> // for size_t
+
+#include "WString.h"
+#include "Printable.h"
+
+#define DEC 10
+#define HEX 16
+#define OCT 8
+#define BIN 2
+
+class Print
+{
+  private:
+    int write_error;
+    size_t printNumber(unsigned long, uint8_t);
+    size_t printFloat(double, uint8_t);
+  protected:
+    void setWriteError(int err = 1) { write_error = err; }
+  public:
+    Print() : write_error(0) {}
+
+    int getWriteError() { return write_error; }
+    void clearWriteError() { setWriteError(0); }
+
+    virtual size_t write(uint8_t) = 0;
+    size_t write(const char *str) {
+      if (str == NULL) return 0;
+      return write((const uint8_t *)str, strlen(str));
+    }
+//    virtual size_t write(const uint8_t *buffer, size_t size);
+    size_t write(const uint8_t *buffer, size_t size) {
+       printf("%s", buffer);
+       return size;
+    }
+
+    size_t print(const __FlashStringHelper *);
+    size_t print(const String &);
+    size_t print(const char[]);
+    size_t print(char);
+    size_t print(unsigned char, int = DEC);
+    size_t print(int, int = DEC);
+    size_t print(unsigned int, int = DEC);
+    size_t print(long, int = DEC);
+    size_t print(unsigned long, int = DEC);
+    size_t print(double, int = 2);
+    size_t print(const Printable&);
+
+    size_t println(const __FlashStringHelper *);
+    size_t println(const String &s);
+    size_t println(const char[]);
+    size_t println(char);
+    size_t println(unsigned char, int = DEC);
+    size_t println(int, int = DEC);
+    size_t println(unsigned int, int = DEC);
+    size_t println(long, int = DEC);
+    size_t println(unsigned long, int = DEC);
+    size_t println(double, int = 2);
+    size_t println(const Printable&);
+    size_t println(void);
+};
+
+#endif
diff -rupN ./include/WString.h ../1.16_modified/include/WString.h
--- ./include/WString.h	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/include/WString.h	2014-10-06 21:43:49.898891784 -0600
@@ -0,0 +1,224 @@
+/*
+  WString.h - String library for Wiring & Arduino
+  ...mostly rewritten by Paul Stoffregen...
+  Copyright (c) 2009-10 Hernando Barragan.  All right reserved.
+  Copyright 2011, Paul Stoffregen, paul@pjrc.com
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef String_class_h
+#define String_class_h
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+//#include <avr/pgmspace.h>
+
+// When compiling programs with this class, the following gcc parameters
+// dramatically increase performance and memory (RAM) efficiency, typically
+// with little or no increase in code size.
+//     -felide-constructors
+//     -std=c++0x
+
+class __FlashStringHelper;
+#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
+
+// An inherited class for holding the result of a concatenation.  These
+// result objects are assumed to be writable by subsequent concatenations.
+class StringSumHelper;
+
+// The string class
+class String
+{
+	// use a function pointer to allow for "if (s)" without the
+	// complications of an operator bool(). for more information, see:
+	// http://www.artima.com/cppsource/safebool.html
+	typedef void (String::*StringIfHelperType)() const;
+	void StringIfHelper() const {}
+
+public:
+	// constructors
+	// creates a copy of the initial value.
+	// if the initial value is null or invalid, or if memory allocation
+	// fails, the string will be marked as invalid (i.e. "if (s)" will
+	// be false).
+	String(const char *cstr = "");
+	String(const String &str);
+	String(const __FlashStringHelper *str);
+	#ifdef __GXX_EXPERIMENTAL_CXX0X__
+	String(String &&rval);
+	String(StringSumHelper &&rval);
+	#endif
+	explicit String(char c);
+	explicit String(unsigned char, unsigned char base=10);
+	explicit String(int, unsigned char base=10);
+	explicit String(unsigned int, unsigned char base=10);
+	explicit String(long, unsigned char base=10);
+	explicit String(unsigned long, unsigned char base=10);
+	explicit String(float, unsigned char decimalPlaces=2);
+	explicit String(double, unsigned char decimalPlaces=2);
+	~String(void);
+
+	// memory management
+	// return true on success, false on failure (in which case, the string
+	// is left unchanged).  reserve(0), if successful, will validate an
+	// invalid string (i.e., "if (s)" will be true afterwards)
+	unsigned char reserve(unsigned int size);
+	inline unsigned int length(void) const {return len;}
+
+	// creates a copy of the assigned value.  if the value is null or
+	// invalid, or if the memory allocation fails, the string will be
+	// marked as invalid ("if (s)" will be false).
+	String & operator = (const String &rhs);
+	String & operator = (const char *cstr);
+	String & operator = (const __FlashStringHelper *str);
+	#ifdef __GXX_EXPERIMENTAL_CXX0X__
+	String & operator = (String &&rval);
+	String & operator = (StringSumHelper &&rval);
+	#endif
+
+	// concatenate (works w/ built-in types)
+
+	// returns true on success, false on failure (in which case, the string
+	// is left unchanged).  if the argument is null or invalid, the
+	// concatenation is considered unsucessful.
+	unsigned char concat(const String &str);
+	unsigned char concat(const char *cstr);
+	unsigned char concat(char c);
+	unsigned char concat(unsigned char c);
+	unsigned char concat(int num);
+	unsigned char concat(unsigned int num);
+	unsigned char concat(long num);
+	unsigned char concat(unsigned long num);
+	unsigned char concat(float num);
+	unsigned char concat(double num);
+	unsigned char concat(const __FlashStringHelper * str);
+
+	// if there's not enough memory for the concatenated value, the string
+	// will be left unchanged (but this isn't signalled in any way)
+	String & operator += (const String &rhs)	{concat(rhs); return (*this);}
+	String & operator += (const char *cstr)		{concat(cstr); return (*this);}
+	String & operator += (char c)			{concat(c); return (*this);}
+	String & operator += (unsigned char num)		{concat(num); return (*this);}
+	String & operator += (int num)			{concat(num); return (*this);}
+	String & operator += (unsigned int num)		{concat(num); return (*this);}
+	String & operator += (long num)			{concat(num); return (*this);}
+	String & operator += (unsigned long num)	{concat(num); return (*this);}
+	String & operator += (float num)		{concat(num); return (*this);}
+	String & operator += (double num)		{concat(num); return (*this);}
+	String & operator += (const __FlashStringHelper *str){concat(str); return (*this);}
+
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, float num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, double num);
+	friend StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs);
+
+	// comparison (only works w/ Strings and "strings")
+	operator StringIfHelperType() const { return buffer ? &String::StringIfHelper : 0; }
+	int compareTo(const String &s) const;
+	unsigned char equals(const String &s) const;
+	unsigned char equals(const char *cstr) const;
+	unsigned char operator == (const String &rhs) const {return equals(rhs);}
+	unsigned char operator == (const char *cstr) const {return equals(cstr);}
+	unsigned char operator != (const String &rhs) const {return !equals(rhs);}
+	unsigned char operator != (const char *cstr) const {return !equals(cstr);}
+	unsigned char operator <  (const String &rhs) const;
+	unsigned char operator >  (const String &rhs) const;
+	unsigned char operator <= (const String &rhs) const;
+	unsigned char operator >= (const String &rhs) const;
+	unsigned char equalsIgnoreCase(const String &s) const;
+	unsigned char startsWith( const String &prefix) const;
+	unsigned char startsWith(const String &prefix, unsigned int offset) const;
+	unsigned char endsWith(const String &suffix) const;
+
+	// character acccess
+	char charAt(unsigned int index) const;
+	void setCharAt(unsigned int index, char c);
+	char operator [] (unsigned int index) const;
+	char& operator [] (unsigned int index);
+	void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const;
+	void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const
+		{getBytes((unsigned char *)buf, bufsize, index);}
+	const char * c_str() const { return buffer; }
+
+	// search
+	int indexOf( char ch ) const;
+	int indexOf( char ch, unsigned int fromIndex ) const;
+	int indexOf( const String &str ) const;
+	int indexOf( const String &str, unsigned int fromIndex ) const;
+	int lastIndexOf( char ch ) const;
+	int lastIndexOf( char ch, unsigned int fromIndex ) const;
+	int lastIndexOf( const String &str ) const;
+	int lastIndexOf( const String &str, unsigned int fromIndex ) const;
+	String substring( unsigned int beginIndex ) const { return substring(beginIndex, len); };
+	String substring( unsigned int beginIndex, unsigned int endIndex ) const;
+
+	// modification
+	void replace(char find, char replace);
+	void replace(const String& find, const String& replace);
+	void remove(unsigned int index);
+	void remove(unsigned int index, unsigned int count);
+	void toLowerCase(void);
+	void toUpperCase(void);
+	void trim(void);
+
+	// parsing/conversion
+	long toInt(void) const;
+	float toFloat(void) const;
+
+protected:
+	char *buffer;	        // the actual char array
+	unsigned int capacity;  // the array length minus one (for the '\0')
+	unsigned int len;       // the String length (not counting the '\0')
+protected:
+	void init(void);
+	void invalidate(void);
+	unsigned char changeBuffer(unsigned int maxStrLen);
+	unsigned char concat(const char *cstr, unsigned int length);
+
+	// copy and move
+	String & copy(const char *cstr, unsigned int length);
+	String & copy(const __FlashStringHelper *pstr, unsigned int length);
+	#ifdef __GXX_EXPERIMENTAL_CXX0X__
+	void move(String &rhs);
+	#endif
+};
+
+class StringSumHelper : public String
+{
+public:
+	StringSumHelper(const String &s) : String(s) {}
+	StringSumHelper(const char *p) : String(p) {}
+	StringSumHelper(char c) : String(c) {}
+	StringSumHelper(unsigned char num) : String(num) {}
+	StringSumHelper(int num) : String(num) {}
+	StringSumHelper(unsigned int num) : String(num) {}
+	StringSumHelper(long num) : String(num) {}
+	StringSumHelper(unsigned long num) : String(num) {}
+	StringSumHelper(float num) : String(num) {}
+	StringSumHelper(double num) : String(num) {}
+};
+
+#endif  // __cplusplus
+#endif  // String_class_h
diff -rupN ./Makefile ../1.16_modified/Makefile
--- ./Makefile	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/Makefile	2014-10-06 21:43:49.888891905 -0600
@@ -0,0 +1,133 @@
+project_NAME := libU8glib.a
+project_C_SRCS := utility/chessengine.c \
+		utility/u8g_com_raspberrypi_hw_spi.c \
+		utility/u8g_com_raspberrypi_ssd_i2c.c \
+		utility/u8g_com_atmega_st7920_hw_spi.c \
+		utility/u8g_dev_ssd1306_128x32.c \
+		utility/u8g_dev_st7920_202x32.c \
+		utility/u8g_pb32h1.c \
+		utility/u8g_bitmap.c \
+		utility/u8g_com_atmega_st7920_spi.c \
+		utility/u8g_dev_ssd1306_128x64.c \
+		utility/u8g_dev_t6963_128x64.c \
+		utility/u8g_pb8h1.c \
+		utility/u8g_circle.c \
+		utility/u8g_com_atmega_sw_spi.c \
+		utility/u8g_dev_ssd1309_128x64.c \
+		utility/u8g_dev_t6963_240x128.c \
+		utility/u8g_pb8h1f.c \
+		utility/u8g_clip.c \
+		utility/u8g_com_i2c.c \
+		utility/u8g_dev_ssd1322_nhd31oled_bw.c \
+		utility/u8g_dev_t6963_240x64.c \
+		utility/u8g_pb8h2.c \
+		utility/u8g_com_api_16gr.c \
+		utility/u8g_com_io.c \
+		utility/u8g_dev_ssd1322_nhd31oled_gr.c \
+		utility/u8g_dev_tls8204_84x48.c \
+		utility/u8g_pb8h8.c \
+		utility/u8g_com_api.c \
+		utility/u8g_com_null.c \
+		utility/u8g_dev_ssd1325_nhd27oled_bw.c \
+		utility/u8g_dev_uc1601_c128032.c \
+		utility/u8g_pb8v1.c \
+		utility/u8g_com_arduino_common.c \
+		utility/u8g_cursor.c \
+		utility/u8g_dev_ssd1325_nhd27oled_bw_new.c \
+		utility/u8g_dev_uc1610_dogxl160.c \
+		utility/u8g_pb8v2.c \
+		utility/u8g_com_arduino_fast_parallel.c \
+		utility/u8g_delay.c \
+		utility/u8g_dev_ssd1325_nhd27oled_gr.c \
+		utility/u8g_dev_uc1701_dogs102.c \
+		utility/u8g_pb.c \
+		utility/u8g_com_arduino_hw_spi.c \
+		utility/u8g_dev_flipdisc_2x7.c \
+		utility/u8g_dev_ssd1325_nhd27oled_gr_new.c \
+		utility/u8g_dev_uc1701_mini12864.c \
+		utility/u8g_pbxh16.c \
+		utility/u8g_com_arduino_no_en_parallel.c \
+		utility/u8g_dev_gprof.c \
+		utility/u8g_dev_ssd1327_96x96_gr.c \
+		utility/u8g_ellipse.c \
+		utility/u8g_pbxh24.c \
+		utility/u8g_com_arduino_parallel.c \
+		utility/u8g_dev_ht1632.c \
+		utility/u8g_dev_ssd1351_128x128.c \
+		utility/u8g_font.c \
+		utility/u8g_rect.c \
+		utility/u8g_com_arduino_port_d_wr.c \
+		utility/u8g_dev_ili9325d_320x240.c \
+		utility/u8g_dev_st7565_64128n.c \
+		utility/u8g_font_data.c \
+		utility/u8g_rot.c \
+		utility/u8g_com_arduino_ssd_i2c.c \
+		utility/u8g_dev_ks0108_128x64.c \
+		utility/u8g_dev_st7565_dogm128.c \
+		utility/u8g_scale.c \
+		utility/u8g_com_arduino_st7920_custom.c \
+		utility/u8g_dev_lc7981_160x80.c \
+		utility/u8g_dev_st7565_dogm132.c \
+		utility/u8g_line.c \
+		utility/u8g_state.c \
+		utility/u8g_com_arduino_st7920_hw_spi.c \
+		utility/u8g_dev_lc7981_240x128.c \
+		utility/u8g_dev_st7565_lm6059.c \
+		utility/u8g_ll_api.c \
+		utility/u8g_u16toa.c \
+		utility/u8g_com_arduino_st7920_spi.c \
+		utility/u8g_dev_lc7981_240x64.c \
+		utility/u8g_dev_st7565_lm6063.c \
+		utility/u8g_page.c \
+		utility/u8g_u8toa.c \
+		utility/u8g_com_arduino_std_sw_spi.c \
+		utility/u8g_dev_lc7981_320x64.c \
+		utility/u8g_dev_st7565_nhd_c12832.c \
+		utility/u8g_pb14v1.c \
+		utility/u8g_virtual_screen.c \
+		utility/u8g_com_arduino_sw_spi.c \
+		utility/u8g_dev_null.c \
+		utility/u8g_dev_st7565_nhd_c12864.c \
+		utility/u8g_pb16h1.c \
+		utility/u8g_com_arduino_t6963.c \
+		utility/u8g_dev_pcd8544_84x48.c \
+		utility/u8g_dev_st7687_c144mvgd.c \
+		utility/u8g_pb16h2.c \
+		utility/u8g_com_atmega_hw_spi.c \
+		utility/u8g_dev_pcf8812_96x65.c \
+		utility/u8g_dev_st7920_128x64.c \
+		utility/u8g_pb16v1.c \
+		utility/u8g_com_atmega_parallel.c \
+		utility/u8g_dev_sbn1661_122x32.c \
+		utility/u8g_dev_st7920_192x32.c \
+ 　utility/u8g_polygon.c \
+		utility/u8g_pb16v2.c
+
+project_CXX_SRCS := U8glib.cpp
+
+project_C_OBJS := ${project_C_SRCS:.c=.o}
+project_CXX_OBJS := ${project_CXX_SRCS:.cpp=.o}
+project_OBJS := $(project_C_OBJS) $(project_CXX_OBJS)
+project_INCLUDE_DIRS := include
+PREPROCESSOR=-DU8G_RASPBERRY_PI
+
+
+CPPFLAGS += $(foreach includedir,$(project_INCLUDE_DIRS),-I$(includedir))
+CPPFLAGS += $(PREPROCESSOR)
+
+ARFLAGS = rcs
+
+.PHONY: all clean distclean
+
+all: $(project_NAME)
+
+$(project_NAME): $(project_OBJS)
+	ar $(ARFLAGS) $@ $^
+
+clean:
+	@- $(RM) $(project_NAME)
+	@- $(RM) $(project_OBJS)
+
+distclean: clean
+
+
+
diff -rupN ./U8glib.cpp ../1.16_modified/U8glib.cpp
--- ./U8glib.cpp	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/U8glib.cpp	2014-10-06 21:43:49.128901097 -0600
@@ -77,4 +77,3 @@ uint8_t U8GLIB::initRW8Bit(u8g_dev_t *de
   return u8g_InitRW8Bit(&u8g, dev, d0, d1, d2, d3, d4, d5, d6, d7, cs, a0, wr, rd, reset);
 }

-
diff -rupN ./U8glib.h ../1.16_modified/U8glib.h
--- ./U8glib.h	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/U8glib.h	2014-10-06 21:43:49.888891905 -0600
@@ -41,6 +41,8 @@
 #include <Print.h>
 #include "utility/u8g.h"

+#define ARDUINO 200
+

 class U8GLIB : public Print
 {
@@ -57,10 +59,8 @@ class U8GLIB : public Print
   protected:
     uint8_t init8BitFixedPort(u8g_dev_t *dev, uint8_t en, uint8_t cs, uint8_t di, uint8_t rw, uint8_t reset);
   private:
-    uint8_t init8Bit(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
-        uint8_t en, uint8_t cs1, uint8_t cs2, uint8_t di, uint8_t rw = U8G_PIN_NONE, uint8_t reset = U8G_PIN_NONE);
-    uint8_t initRW8Bit(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
-      uint8_t cs, uint8_t a0, uint8_t wr, uint8_t rd, uint8_t reset);
+    uint8_t init8Bit(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t en, uint8_t cs1, uint8_t cs2, uint8_t di, uint8_t rw = U8G_PIN_NONE, uint8_t reset = U8G_PIN_NONE);
+    uint8_t initRW8Bit(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t cs, uint8_t a0, uint8_t wr, uint8_t rd, uint8_t reset);
   public:

     /* constructor */
@@ -76,11 +76,9 @@ class U8GLIB : public Print
       { initHWSPI(dev, cs, a0, reset); }
     U8GLIB(u8g_dev_t *dev, uint8_t options)
       { initI2C(dev, options); }
-    U8GLIB(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
-        uint8_t en, uint8_t cs1, uint8_t cs2, uint8_t di, uint8_t rw, uint8_t reset)
+    U8GLIB(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t en, uint8_t cs1, uint8_t cs2, uint8_t di, uint8_t rw, uint8_t reset)
       { init8Bit(dev, d0, d1, d2, d3, d4, d5, d6, d7, en, cs1, cs2, di, rw, reset); }
-    U8GLIB(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
-        uint8_t cs, uint8_t a0, uint8_t wr, uint8_t rd, uint8_t reset)
+    U8GLIB(u8g_dev_t *dev, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t cs, uint8_t a0, uint8_t wr, uint8_t rd, uint8_t reset)
       { initRW8Bit(dev, d0, d1, d2, d3, d4, d5, d6, d7, cs, a0, wr, rd, reset); }

     uint8_t begin(void) { is_begin = 1; return u8g_Begin(&u8g); }
@@ -93,7 +91,8 @@ class U8GLIB : public Print
 #if defined(ARDUINO) && ARDUINO >= 100
     size_t write(uint8_t c) { tx += u8g_DrawGlyph(&u8g, tx, ty, c); return 1;}
 #else
-    void write(uint8_t c) { tx += u8g_DrawGlyph(&u8g, tx, ty, c); }
+    size_t write(uint8_t c) { tx += u8g_DrawGlyph(&u8g, tx, ty, c); return 1;}
+    //void write(uint8_t c) { tx += u8g_DrawGlyph(&u8g, tx, ty, c); }
 #endif

      /* screen rotation */
diff -rupN ./utility/u8g_com_i2c.c ../1.16_modified/utility/u8g_com_i2c.c
--- ./utility/u8g_com_i2c.c	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/utility/u8g_com_i2c.c	2014-10-06 21:48:30.095504371 -0600
@@ -38,7 +38,7 @@

 #include "u8g.h"

-#define U8G_I2C_WITH_NO_ACK
+//#define U8G_I2C_WITH_NO_ACK

 static uint8_t u8g_i2c_err_code;
 static uint8_t u8g_i2c_opt;		/* U8G_I2C_OPT_NO_ACK */
@@ -243,6 +243,60 @@ void twi_send(uint8_t adr, uint8_t data1
 }
 */

+#elif defined(U8G_RASPBERRY_PI)
+
+#include <wiringPi.h>
+#include <wiringPiI2C.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#define I2C_SLA         0x3c
+
+static int fd=-1;
+static uint8_t i2cMode = 0;
+
+void u8g_i2c_init(uint8_t options) {
+   u8g_i2c_clear_error();
+   u8g_i2c_opt = options;
+
+   if (wiringPiSetup() == -1) {
+      printf("wiringPi-Error\n");
+      exit(1);
+   }
+
+   fd = wiringPiI2CSetup(I2C_SLA);
+   if (fd < 0) {
+      printf ("Unable to open I2C device 0: %s\n", strerror (errno)) ;
+      exit (1) ;
+   }
+   //u8g_SetPIOutput(u8g, U8G_PI_RESET);
+   //u8g_SetPIOutput(u8g, U8G_PI_A0);
+}
+uint8_t u8g_i2c_start(uint8_t sla) {
+   u8g_i2c_send_mode(0);
+
+   return 1;
+}
+
+void u8g_i2c_stop(void) {
+}
+
+uint8_t u8g_i2c_send_mode(uint8_t mode) {
+   i2cMode = mode;
+}
+
+uint8_t u8g_i2c_send_byte(uint8_t data) {
+   wiringPiI2CWriteReg8(fd, i2cMode, data);
+
+   return 1;
+}
+
+uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos)
+{
+  return 1;
+}
+
 #else

 /* empty interface */
diff -rupN ./utility/u8g_com_io.c ../1.16_modified/utility/u8g_com_io.c
--- ./utility/u8g_com_io.c	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/utility/u8g_com_io.c	2014-10-06 21:43:50.138888882 -0600
@@ -191,6 +191,28 @@ uint8_t u8g_GetPinLevel(uint8_t internal
   return 0;
 }

+#elif defined(U8G_RASPBERRY_PI)
+
+#include <wiringPi.h>
+//#include "/usr/local/include/wiringPi.h"
+
+void u8g_SetPinOutput(uint8_t internal_pin_number) {
+   pinMode(internal_pin_number, OUTPUT);
+}
+
+void u8g_SetPinInput(uint8_t internal_pin_number) {
+   pinMode(internal_pin_number, INPUT);
+}
+
+void u8g_SetPinLevel(uint8_t internal_pin_number, uint8_t level) {
+   digitalWrite(internal_pin_number, level);
+}
+
+uint8_t u8g_GetPinLevel(uint8_t internal_pin_number) {
+   return digitalRead(internal_pin_number);
+}
+
+
 #else

 /* convert "port" and "bitpos" to internal pin number */
diff -rupN ./utility/u8g_com_raspberrypi_hw_spi.c ../1.16_modified/utility/u8g_com_raspberrypi_hw_spi.c
--- ./utility/u8g_com_raspberrypi_hw_spi.c	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/utility/u8g_com_raspberrypi_hw_spi.c	2014-10-06 21:43:50.398885737 -0600
@@ -0,0 +1,124 @@
+/*
+
+  u8g_com_raspberrypi_hw_spi.c
+
+  Universal 8bit Graphics Library
+
+  Copyright (c) 2012, olikraus@gmail.com
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without modification,
+  are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice, this list
+    of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright notice, this
+    list of conditions and the following disclaimer in the documentation and/or other
+    materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+  Assumes, that
+    MOSI is at PORTB, Pin 3
+  and
+    SCK is at PORTB, Pin 5
+
+  Update for ATOMIC operation done (01 Jun 2013)
+    U8G_ATOMIC_OR(ptr, val)
+    U8G_ATOMIC_AND(ptr, val)
+    U8G_ATOMIC_START()
+    U8G_ATOMIC_END()
+
+
+
+*/
+
+#include "u8g.h"
+
+
+
+#if defined(U8G_RASPBERRY_PI)
+
+#include <wiringPiSPI.h>
+#include <wiringPi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+uint8_t u8g_com_raspberrypi_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
+{
+  switch(msg)
+  {
+    case U8G_COM_MSG_STOP:
+      break;
+
+    case U8G_COM_MSG_INIT:
+		// check wiringPi setup
+		if (wiringPiSetup() == -1)
+		{
+			printf("wiringPi-Error\n");
+			exit(1);
+		}
+
+		if (wiringPiSPISetup (0, 100000) < 0)
+		{
+			printf ("Unable to open SPI device 0: %s\n", strerror (errno)) ;
+			exit (1) ;
+		}
+
+		u8g_SetPIOutput(u8g, U8G_PI_RESET);
+		u8g_SetPIOutput(u8g, U8G_PI_A0);
+
+      break;
+
+    case U8G_COM_MSG_ADDRESS:                     /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
+	  u8g_SetPILevel(u8g, U8G_PI_A0, arg_val);
+      break;
+
+    case U8G_COM_MSG_CHIP_SELECT:
+		/* Done by the SPI hardware */
+      break;
+
+    case U8G_COM_MSG_RESET:
+      u8g_SetPILevel(u8g, U8G_PI_RESET, arg_val);
+      break;
+
+    case U8G_COM_MSG_WRITE_BYTE:
+		wiringPiSPIDataRW (0, &arg_val, 1) ;
+      break;
+
+    case U8G_COM_MSG_WRITE_SEQ:
+		wiringPiSPIDataRW (0, arg_ptr, arg_val);
+      break;
+
+	case U8G_COM_MSG_WRITE_SEQ_P:
+		wiringPiSPIDataRW (0, arg_ptr, arg_val);
+      break;
+  }
+  return 1;
+}
+
+#else
+
+uint8_t u8g_com_raspberrypi_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
+{
+  return 1;
+}
+
+#endif
+
+
diff -rupN ./utility/u8g_com_raspberrypi_ssd_i2c.c ../1.16_modified/utility/u8g_com_raspberrypi_ssd_i2c.c
--- ./utility/u8g_com_raspberrypi_ssd_i2c.c	1969-12-31 17:00:00.000000000 -0700
+++ ../1.16_modified/utility/u8g_com_raspberrypi_ssd_i2c.c	2014-10-06 21:51:00.673685198 -0600
@@ -0,0 +1,176 @@
+/*
+  Special pin usage:
+    U8G_PI_I2C_OPTION	additional options
+    U8G_PI_A0_STATE	used to store the last value of the command/data register selection
+    U8G_PI_SET_A0		1: Signal request to update I2C device with new A0_STATE, 0: Do nothing, A0_STATE matches I2C device
+    U8G_PI_SCL		clock line (NOT USED)
+    U8G_PI_SDA		data line (NOT USED)
+
+    U8G_PI_RESET		reset line (currently disabled, see below)
+
+  Protocol:
+    SLA, Cmd/Data Selection, Arguments
+    The command/data register is selected by a special instruction byte, which is sent after SLA
+
+    The continue bit is always 0 so that a (re)start is equired for the change from cmd to/data mode
+*/
+
+#include "u8g.h"
+
+#if defined(U8G_RASPBERRY_PI)
+
+#include <wiringPi.h>
+#include <wiringPiI2C.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#define I2C_SLA		0x3c
+#define I2C_CMD_MODE	0x000
+#define I2C_DATA_MODE	0x040
+
+#if defined(U8G_WITH_PINLIST)
+
+uint8_t u8g_com_raspberrypi_ssd_start_sequence(u8g_t *u8g)
+{
+  /* are we requested to set the a0 state? */
+  if ( u8g->pin_list[U8G_PI_SET_A0] == 0 )
+    return 1;
+
+  /* setup bus, might be a repeated start */
+  if ( u8g_i2c_start(I2C_SLA) == 0 )
+    return 0;
+  if ( u8g->pin_list[U8G_PI_A0_STATE] == 0 )
+  {
+    if ( u8g_i2c_send_mode(I2C_CMD_MODE) == 0 )
+      return 0;
+  }
+  else
+  {
+    if ( u8g_i2c_send_mode(I2C_DATA_MODE) == 0 )
+      return 0;
+  }
+
+
+  u8g->pin_list[U8G_PI_SET_A0] = 0;
+  return 1;
+}
+
+uint8_t u8g_com_raspberrypi_ssd_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
+{
+  switch(msg)
+  {
+    case U8G_COM_MSG_INIT:
+      u8g_i2c_init(u8g->pin_list[U8G_PI_I2C_OPTION]);
+      u8g_SetPIOutput(u8g, U8G_PI_RESET);
+      u8g_SetPIOutput(u8g, U8G_PI_A0);
+      break;
+
+    case U8G_COM_MSG_STOP:
+      break;
+
+    case U8G_COM_MSG_RESET:
+      break;
+
+    case U8G_COM_MSG_CHIP_SELECT:
+      u8g->pin_list[U8G_PI_A0_STATE] = 0;
+      u8g->pin_list[U8G_PI_SET_A0] = 1;		/* force a0 to set again, also forces start condition */
+      if ( arg_val == 0 )
+      {
+        /* disable chip, send stop condition */
+	u8g_i2c_stop();
+     }
+      else
+      {
+        /* enable, do nothing: any byte writing will trigger the i2c start */
+      }
+      break;
+
+    case U8G_COM_MSG_WRITE_BYTE:
+      //u8g->pin_list[U8G_PI_SET_A0] = 1;
+      if ( u8g_com_raspberrypi_ssd_start_sequence(u8g) == 0 )
+	return u8g_i2c_stop(), 0;
+      if ( u8g_i2c_send_byte(arg_val) == 0 )
+	return u8g_i2c_stop(), 0;
+      // u8g_i2c_stop();
+      break;
+
+    case U8G_COM_MSG_WRITE_SEQ:
+      //u8g->pin_list[U8G_PI_SET_A0] = 1;
+      if ( u8g_com_raspberrypi_ssd_start_sequence(u8g) == 0 )
+	return u8g_i2c_stop(), 0;
+      {
+        register uint8_t *ptr = (uint8_t *)arg_ptr;
+        while( arg_val > 0 )
+        {
+	  if ( u8g_i2c_send_byte(*ptr++) == 0 )
+	    return u8g_i2c_stop(), 0;
+          arg_val--;
+        }
+      }
+      // u8g_i2c_stop();
+      break;
+
+    case U8G_COM_MSG_WRITE_SEQ_P:
+      //u8g->pin_list[U8G_PI_SET_A0] = 1;
+      if ( u8g_com_raspberrypi_ssd_start_sequence(u8g) == 0 )
+	return u8g_i2c_stop(), 0;
+      {
+        register uint8_t *ptr = (uint8_t *)arg_ptr;
+        while( arg_val > 0 )
+        {
+	  if ( u8g_i2c_send_byte(u8g_pgm_read(ptr)) == 0 )
+	    return 0;
+          ptr++;
+          arg_val--;
+        }
+      }
+      // u8g_i2c_stop();
+      break;
+
+    case U8G_COM_MSG_ADDRESS:                     /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
+      u8g->pin_list[U8G_PI_A0_STATE] = arg_val;
+      u8g->pin_list[U8G_PI_SET_A0] = 1;		/* force a0 to set again */
+
+#ifdef OLD_CODE
+      if ( i2c_state != 0 )
+      {
+	u8g_i2c_stop();
+	i2c_state = 0;
+      }
+
+      if ( u8g_com_raspberrypi_ssd_start_sequence(arg_val) == 0 )
+	return 0;
+
+      /* setup bus, might be a repeated start */
+      /*
+      if ( u8g_i2c_start(I2C_SLA) == 0 )
+	return 0;
+      if ( arg_val == 0 )
+      {
+	i2c_state = 1;
+
+	if ( u8g_i2c_send_byte(I2C_CMD_MODE) == 0 )
+	  return 0;
+      }
+      else
+      {
+	i2c_state = 2;
+	if ( u8g_i2c_send_byte(I2C_DATA_MODE) == 0 )
+	  return 0;
+      }
+      */
+#endif
+      break;
+  }
+  return 1;
+}
+
+#else	/* defined(U8G_WITH_PINLIST) */
+
+uint8_t u8g_com_raspberrypi_ssd_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
+   return 1;
+}
+
+#endif	/* defined(U8G_WITH_PINLIST) */
+#endif
diff -rupN ./utility/u8g_delay.c ../1.16_modified/utility/u8g_delay.c
--- ./utility/u8g_delay.c	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/utility/u8g_delay.c	2014-10-06 21:43:50.188888277 -0600
@@ -61,6 +61,8 @@
 #  else
 #    define USE_ARDUINO_DELAY
 #  endif
+#elif defined(U8G_RASPBERRY_PI)
+#  define USE_RASPBERRYPI_DELAY
 #elif defined(__AVR__)
 #  define USE_AVR_DELAY
 #elif defined(__18CXX)
@@ -82,6 +84,26 @@ void u8g_10MicroDelay(void);

 /*==== Part 2: Definition of the delay procedures ====*/

+/*== Raspberry Pi Delay ==*/
+#if defined (USE_RASPBERRYPI_DELAY)
+#include <wiringPi.h>
+//#include "/usr/local/include/wiringPi.h"
+void u8g_Delay(uint16_t val) {
+   //delay(val);
+   //usleep((uint32_t)val*(uint32_t)1000);
+   delayMicroseconds((uint32_t)val*(uint32_t)1000);
+}
+void u8g_MicroDelay(void)
+{
+   usleep(1);
+}
+void u8g_10MicroDelay(void)
+{
+   usleep(10);
+}
+#endif
+
+
 /*== AVR Delay ==*/

 #if defined(USE_AVR_DELAY)
diff -rupN ./utility/u8g_dev_ssd1306_128x32.c ../1.16_modified/utility/u8g_dev_ssd1306_128x32.c
--- ./utility/u8g_dev_ssd1306_128x32.c	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/utility/u8g_dev_ssd1306_128x32.c	2014-10-06 21:43:50.448885132 -0600
@@ -258,7 +258,7 @@ uint8_t u8g_dev_ssd1306_128x32_2x_fn(u8g
         u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x32_data_start);
         u8g_WriteByte(u8g, dev, 0x0b0 | (pb->p.page*2));	/* select current page (SSD1306) */
         u8g_SetAddress(u8g, dev, 1);					/* data mode */
-	u8g_WriteSequence(u8g, dev, pb->width, pb->buf);
+	u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
         u8g_SetChipSelect(u8g, dev, 0);

         u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x32_data_start);
diff -rupN ./utility/u8g_dev_ssd1306_128x64.c ../1.16_modified/utility/u8g_dev_ssd1306_128x64.c
--- ./utility/u8g_dev_ssd1306_128x64.c	2014-07-05 08:10:52.000000000 -0600
+++ ../1.16_modified/utility/u8g_dev_ssd1306_128x64.c	2014-10-06 21:43:50.638882834 -0600
@@ -116,7 +116,8 @@ static const uint8_t u8g_dev_ssd1306_128
   U8G_ESC_CS(1),             /* enable chip */

   0x0ae,				/* display off, sleep mode */
-  0x0d5, 0x080,		/* clock divide ratio (0x00=1) and oscillator frequency (0x8) */
+  //0x0d5, 0x080,		/* clock divide ratio (0x00=1) and oscillator frequency (0x8) */
+  0x0d5, 0x0f0,		/* clock divide ratio (0x00=1) and oscillator frequency (0x8) */
   0x0a8, 0x03f,		/* */

   0x0d3, 0x000,		/*  */
@@ -127,10 +128,12 @@ static const uint8_t u8g_dev_ssd1306_128

   0x020, 0x002,		/* 2012-05-27: page addressing mode */
   0x0a1,				/* segment remap a0/a1*/
-  0x0c8,				/* c0: scan dir normal, c8: reverse */
+  0x0c0,				/* c0: scan dir normal, c8: reverse */
   0x0da, 0x012,		/* com pin HW config, sequential com pin config (bit 4), disable left/right remap (bit 5) */
   0x081, 0x0cf,		/* [2] set contrast control */
-  0x0d9, 0x0f1,		/* [2] pre-charge period 0x022/f1*/
+  0x0d9, 0x022,		/* [2] pre-charge period 0x022/f1*/
+  //0x0d9, 0x0f1,		/* [2] pre-charge period 0x022/f1*/
+  //0x0db, 0x040,		/* vcomh deselect level */
   0x0db, 0x040,		/* vcomh deselect level */

   0x02e,				/* 2012-05-27: Deactivate scroll */
@@ -324,7 +327,7 @@ uint8_t u8g_dev_ssd1306_128x64_2x_fn(u8g
         u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x64_data_start);
         u8g_WriteByte(u8g, dev, 0x0b0 | (pb->p.page*2)); /* select current page (SSD1306) */
         u8g_SetAddress(u8g, dev, 1);           /* data mode */
-	u8g_WriteSequence(u8g, dev, pb->width, pb->buf);
+	u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
         u8g_SetChipSelect(u8g, dev, 0);

         u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x64_data_start);
@@ -361,7 +364,7 @@ uint8_t u8g_dev_sh1106_128x64_2x_fn(u8g_
         u8g_WriteEscSeqP(u8g, dev, u8g_dev_sh1106_128x64_data_start);
         u8g_WriteByte(u8g, dev, 0x0b0 | (pb->p.page*2)); /* select current page (SSD1306) */
         u8g_SetAddress(u8g, dev, 1);           /* data mode */
-	u8g_WriteSequence(u8g, dev, pb->width, pb->buf);
+	u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
         u8g_SetChipSelect(u8g, dev, 0);

         u8g_WriteEscSeqP(u8g, dev, u8g_dev_sh1106_128x64_data_start);
diff -rupN ./utility/u8g.h ../1.16_modified/utility/u8g.h
--- ./utility/u8g.h	2014-07-05 08:10:53.000000000 -0600
+++ ../1.16_modified/utility/u8g.h	2014-10-06 21:43:51.378873884 -0600
@@ -64,6 +64,7 @@ typedef signed short int16_t;
 #if defined(__AVR__) || defined(ARDUINO)
 #define U8G_WITH_PINLIST
 #endif
+#define U8G_WITH_PINLIST


 #ifdef __cplusplus
@@ -632,6 +633,9 @@ uint8_t u8g_com_atmega_st7920_sw_spi_fn(
 uint8_t u8g_com_atmega_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
 uint8_t u8g_com_atmega_parallel_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);    /* u8g_com_atmega_parallel.c */

+uint8_t u8g_com_raspberrypi_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);                /* u8g_com_rasperrypi_hw_spi.c */
+uint8_t u8g_com_raspberrypi_ssd_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);		/* u8g_com_raspberrypi_ssd_i2c.c */
+

 /*
   Translation of system specific com drives to generic com names
@@ -646,6 +650,17 @@ uint8_t u8g_com_atmega_parallel_fn(u8g_t
 defined(__18CXX) || defined(__PIC32MX)

 */
+
+/* ==== HW SPI, Raspberry PI ====*/
+#if defined(U8G_RASPBERRY_PI)
+#define U8G_COM_HW_SPI u8g_com_raspberrypi_hw_spi_fn
+#define U8G_COM_SW_SPI u8g_com_null_fn
+
+/* I'm sure there must be some mad reason for needing this */
+#define U8G_COM_ST7920_SW_SPI u8g_com_null_fn
+#define U8G_COM_ST7920_HW_SPI u8g_com_null_fn
+#endif
+
 /* ==== HW SPI, Arduino ====*/
 #if defined(ARDUINO)
 #if defined(__AVR__)
@@ -681,7 +696,6 @@ defined(__18CXX) || defined(__PIC32MX)
 #define U8G_COM_HW_SPI u8g_com_null_fn
 #define U8G_COM_ST7920_HW_SPI u8g_com_null_fn
 #endif
-
 #ifndef U8G_COM_HW_USART_SPI
 #define U8G_COM_HW_USART_SPI u8g_com_null_fn
 #endif
@@ -754,6 +768,13 @@ defined(__18CXX) || defined(__PIC32MX)
 #define U8G_COM_SSD_I2C u8g_com_arduino_ssd_i2c_fn
 #endif
 #endif
+
+#ifndef U8G_COM_SSD_I2C
+#if defined(U8G_RASPBERRY_PI)
+#define U8G_COM_SSD_I2C u8g_com_raspberrypi_ssd_i2c_fn
+#endif
+#endif
+
 #ifndef U8G_COM_SSD_I2C
 #define U8G_COM_SSD_I2C u8g_com_null_fn
 #endif
@@ -1373,6 +1394,7 @@ void u8g_i2c_init(uint8_t options) U8G_N
 uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos) U8G_NOINLINE;
 uint8_t u8g_i2c_start(uint8_t sla) U8G_NOINLINE;
 uint8_t u8g_i2c_send_byte(uint8_t data) U8G_NOINLINE;
+uint8_t u8g_i2c_send_mode(uint8_t mode) U8G_NOINLINE;
 void u8g_i2c_stop(void) U8G_NOINLINE;


diff -rupN ./utility/u8g_state.c ../1.16_modified/utility/u8g_state.c
--- ./utility/u8g_state.c	2014-07-05 08:10:53.000000000 -0600
+++ ../1.16_modified/utility/u8g_state.c	2014-10-06 21:43:50.878879932 -0600
@@ -107,6 +107,14 @@ void u8g_backup_spi(uint8_t msg)
   }
 }

+#elif defined (U8G_RASPBERRY_PI)
+
+#include <stdio.h>
+
+void u8g_backup_spi(uint8_t msg) {
+  printf("u8g_backup_spi %d\r\n",msg);
+}
+
 #elif defined(ARDUINO) && defined(__SAM3X8E__)		// Arduino Due, maybe we should better check for __SAM3X8E__

 #include "sam.h"
