Simple RPG Library

Dependents:   Audio_Player Wav_player_RPG_menu lcd_menu Lab3 ... more

Committer:
canderson199
Date:
Fri Oct 12 14:01:48 2012 +0000
Revision:
0:4a7e5f6a59a4
Child:
1:0b389c2c21b5
Simple RPG library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
canderson199 0:4a7e5f6a59a4 1 /**
canderson199 0:4a7e5f6a59a4 2 * =============================================================================
canderson199 0:4a7e5f6a59a4 3 * Rotary Pulse Generator class (Version 0.0.1)
canderson199 0:4a7e5f6a59a4 4 * =============================================================================
canderson199 0:4a7e5f6a59a4 5 * Copyright (c) 2012 Christopher Anderson
canderson199 0:4a7e5f6a59a4 6 *
canderson199 0:4a7e5f6a59a4 7 * Permission is hereby granted, free of charge, to any person obtaining a copy
canderson199 0:4a7e5f6a59a4 8 * of this software and associated documentation files (the "Software"), to deal
canderson199 0:4a7e5f6a59a4 9 * in the Software without restriction, including without limitation the rights
canderson199 0:4a7e5f6a59a4 10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
canderson199 0:4a7e5f6a59a4 11 * copies of the Software, and to permit persons to whom the Software is
canderson199 0:4a7e5f6a59a4 12 * furnished to do so, subject to the following conditions:
canderson199 0:4a7e5f6a59a4 13 *
canderson199 0:4a7e5f6a59a4 14 * The above copyright notice and this permission notice shall be included in
canderson199 0:4a7e5f6a59a4 15 * all copies or substantial portions of the Software.
canderson199 0:4a7e5f6a59a4 16 *
canderson199 0:4a7e5f6a59a4 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
canderson199 0:4a7e5f6a59a4 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
canderson199 0:4a7e5f6a59a4 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
canderson199 0:4a7e5f6a59a4 20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
canderson199 0:4a7e5f6a59a4 21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
canderson199 0:4a7e5f6a59a4 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
canderson199 0:4a7e5f6a59a4 23 * THE SOFTWARE.
canderson199 0:4a7e5f6a59a4 24 * =============================================================================
canderson199 0:4a7e5f6a59a4 25 */
canderson199 0:4a7e5f6a59a4 26
canderson199 0:4a7e5f6a59a4 27 #ifndef MBED_RPG_H
canderson199 0:4a7e5f6a59a4 28 #define MBED_RPG_H
canderson199 0:4a7e5f6a59a4 29
canderson199 0:4a7e5f6a59a4 30 #include "mbed.h"
canderson199 0:4a7e5f6a59a4 31
canderson199 0:4a7e5f6a59a4 32 class RPG{
canderson199 0:4a7e5f6a59a4 33 public:
canderson199 0:4a7e5f6a59a4 34 RPG(PinName pA, PinName pB, PinName pPB);
canderson199 0:4a7e5f6a59a4 35
canderson199 0:4a7e5f6a59a4 36 //Dispose
canderson199 0:4a7e5f6a59a4 37 ~RPG();
canderson199 0:4a7e5f6a59a4 38
canderson199 0:4a7e5f6a59a4 39 //Get Direction
canderson199 0:4a7e5f6a59a4 40 int dir();
canderson199 0:4a7e5f6a59a4 41 //Check Push Button
canderson199 0:4a7e5f6a59a4 42 bool pb();
canderson199 0:4a7e5f6a59a4 43 //Digital In (pulled up)
canderson199 0:4a7e5f6a59a4 44
canderson199 0:4a7e5f6a59a4 45
canderson199 0:4a7e5f6a59a4 46 private:
canderson199 0:4a7e5f6a59a4 47 BusInOut chRPG;
canderson199 0:4a7e5f6a59a4 48 DigitalIn PB;
canderson199 0:4a7e5f6a59a4 49 int RPGO;
canderson199 0:4a7e5f6a59a4 50 int RPGN;
canderson199 0:4a7e5f6a59a4 51 };
canderson199 0:4a7e5f6a59a4 52 #endif