A program allowing the output of one or two Wii Nunchucks to be read via I2C and decoded for use.

Dependencies:   mbed

Committer:
snatch59
Date:
Sun Dec 13 12:19:31 2009 +0000
Revision:
0:d51f5e2478c1

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
snatch59 0:d51f5e2478c1 1 /*
snatch59 0:d51f5e2478c1 2 * WiiNunchuckReader. A program allowing the output of one or two
snatch59 0:d51f5e2478c1 3 * Wii Nunchucks to be read via I2C and decoded for use, using the mbed
snatch59 0:d51f5e2478c1 4 * microcontroller and its associated libraries.
snatch59 0:d51f5e2478c1 5 *
snatch59 0:d51f5e2478c1 6 * Copyright (C) <2009> Petras Saduikis <petras@petras.co.uk>
snatch59 0:d51f5e2478c1 7 *
snatch59 0:d51f5e2478c1 8 * This file is part of WiiNunchuckReader.
snatch59 0:d51f5e2478c1 9 *
snatch59 0:d51f5e2478c1 10 * WiiNunchuckReader is free software: you can redistribute it and/or modify
snatch59 0:d51f5e2478c1 11 * it under the terms of the GNU General Public License as published by
snatch59 0:d51f5e2478c1 12 * the Free Software Foundation, either version 3 of the License, or
snatch59 0:d51f5e2478c1 13 * (at your option) any later version.
snatch59 0:d51f5e2478c1 14 *
snatch59 0:d51f5e2478c1 15 * WiiNunchuckReader is distributed in the hope that it will be useful,
snatch59 0:d51f5e2478c1 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
snatch59 0:d51f5e2478c1 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
snatch59 0:d51f5e2478c1 18 * GNU General Public License for more details.
snatch59 0:d51f5e2478c1 19 *
snatch59 0:d51f5e2478c1 20 * You should have received a copy of the GNU General Public License
snatch59 0:d51f5e2478c1 21 * along with WiiNunchuckReader. If not, see <http://www.gnu.org/licenses/>.
snatch59 0:d51f5e2478c1 22 */
snatch59 0:d51f5e2478c1 23
snatch59 0:d51f5e2478c1 24 #ifndef SNATCH59_I2CCONFIG_H
snatch59 0:d51f5e2478c1 25 #define SNATCH59_I2CCONFIG_H
snatch59 0:d51f5e2478c1 26
snatch59 0:d51f5e2478c1 27 #include <mbed.h>
snatch59 0:d51f5e2478c1 28
snatch59 0:d51f5e2478c1 29 class I2CPort_A
snatch59 0:d51f5e2478c1 30 {
snatch59 0:d51f5e2478c1 31 public:
snatch59 0:d51f5e2478c1 32 static const PinName SDA;
snatch59 0:d51f5e2478c1 33 static const PinName SCL;
snatch59 0:d51f5e2478c1 34 };
snatch59 0:d51f5e2478c1 35
snatch59 0:d51f5e2478c1 36
snatch59 0:d51f5e2478c1 37 class I2CPort_B
snatch59 0:d51f5e2478c1 38 {
snatch59 0:d51f5e2478c1 39 public:
snatch59 0:d51f5e2478c1 40 static const PinName SDA;
snatch59 0:d51f5e2478c1 41 static const PinName SCL;
snatch59 0:d51f5e2478c1 42 };
snatch59 0:d51f5e2478c1 43
snatch59 0:d51f5e2478c1 44 const PinName I2CPort_A::SDA = p9;
snatch59 0:d51f5e2478c1 45 const PinName I2CPort_A::SCL = p10;
snatch59 0:d51f5e2478c1 46
snatch59 0:d51f5e2478c1 47 const PinName I2CPort_B::SDA = p28;
snatch59 0:d51f5e2478c1 48 const PinName I2CPort_B::SCL = p27;
snatch59 0:d51f5e2478c1 49
snatch59 0:d51f5e2478c1 50 #endif