Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

very minor updates to make the video-game-shield compatible with ardu…

…ino 1.0
  • Loading branch information...
commit e506ecf0df74c06d6336f7f91b75848975f470df 1 parent ae21ded
Matthew Beckler matthewbeckler authored
8 ClassicController/ClassicController.cpp
View
@@ -2,7 +2,7 @@
ClassicController.cpp - Library for the Nintendo Wii Classic Controller
Created by Adam Wolf and Matthew Beckler of Wayne and Layne, LLC
http://wayneandlayne.com/projects/video-game-shield/
- Last updated: October 31, 2010
+ Last updated: January 18, 2012 - Arduino 1.0 compatability fix
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,11 @@
Some information taken from http://www.arduino.cc/playground/Main/WiiClassicController
*/
-#include "WProgram.h" // needed for the arduino functions map() and constrain()
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
+#include "WProgram.h"
+#endif
#include "ClassicController.h"
#include <i2cmaster.h>
6 ClassicController/ClassicController.h
View
@@ -2,7 +2,7 @@
ClassicController.h - Library for the Nintendo Wii Classic Controller
Created by: Adam Wolf and Matthew Beckler of Wayne and Layne, LLC
http://wayneandlayne.com/projects/video-game-shield/
- Last updated: October 31, 2010
+ Last updated: January 18, 2012 - Arduino 1.0 compatability fix
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,11 @@
#ifndef CLASSICCONTROLLER_H
#define CLASSICCONTROLLER_H
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
#include "WProgram.h"
+#endif
#define WII_I2C_ADDR 0xA4
#define WII_SELECT_P1 PORTB &= 0xEF // set PB4 = low
9 Nunchuck/nunchuck.cpp
View
@@ -1,7 +1,7 @@
/*
Nunchuck.cpp - Library for Nintendo Wii Nunchuck
Created by Adam Wolf and Matthew Beckler (Wayne and Layne, LLC)
- Last updated: August 16, 2010
+ Last updated: January 18, 2012 - Arduino 1.0 compatability fix
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,12 @@
*/
-#include "WProgram.h" // needed for the arduino functions map() and constrain()
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
+#include "WProgram.h"
+#endif
+
#include "nunchuck.h"
#include <i2cmaster.h>
6 Nunchuck/nunchuck.h
View
@@ -1,7 +1,7 @@
/*
Nunchuck.h - Library for the Nintendo Wii Nunchuck
Created by: Adam Wolf and Matthew Beckler, Wayne and Layne, LLC
- Last updated: August 16, 2010
+ Last updated: January 18, 2012 - Arduino 1.0 compatability fixes
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,11 @@
#ifndef Nunchuck_h
#define Nunchuck_h
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
#include "WProgram.h"
+#endif
#define NUNCHUCK_I2C_ADDR 0xA4
6 VideoGameHelper/examples/tv_life/help.pde
View
@@ -1,5 +1,9 @@
#include <avr/pgmspace.h>
-#include <WProgram.h>
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
+#include "WProgram.h"
+#endif
char cells_per_side = 3;
char border_size=2;
6 i2cmaster/i2cmaster.cpp
View
@@ -19,7 +19,11 @@
#include <inttypes.h>
#include <compat/twi.h>
-#include <WProgram.h>
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
+#include "WProgram.h"
+#endif
#include "i2cmaster.h"
5 pollserial/pollserial.cpp
View
@@ -21,6 +21,7 @@
Modified 23 November 2006 by David A. Mellis
Modified July 2010 by Myles D. Metzler
+ Updated January 18, 2012 - Arduino 1.0 compatability fix (write() now returns size_t)
*/
#include <avr/io.h>
@@ -128,7 +129,7 @@ void pollserial::flush() {
rxbuffer.head = rxbuffer.tail;
}
-void pollserial::write(uint8_t c) {
+size_t pollserial::write(uint8_t c) {
#if defined ( UDR0 )
while (!((UCSR0A) & _BV(UDRE0)));
UDR0 = c;
@@ -136,4 +137,4 @@ void pollserial::write(uint8_t c) {
while (!((UCSRA) & _BV(UDRE)));
UDR = c;
#endif
-}
+}
5 pollserial/pollserial.h
View
@@ -19,6 +19,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Modified July 2010 by Myles D. Metzler
+ Updated January 18, 2012 - Arduino 1.0 compatability fix (write() now returns size_t)
*/
#ifndef PSERIAL_H
@@ -43,9 +44,9 @@ class pollserial : public Print {
uint8_t available(void);
int read(void);
void flush(void);
- virtual void write(uint8_t);
+ virtual size_t write(uint8_t);
using Print::write; // pull in write(str) and write(buf, size) from Print
};
void USART_recieve();
-#endif
+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.