From 98c623dc8969151c0872a2d102d486f9a735d614 Mon Sep 17 00:00:00 2001 From: neoraider Date: Tue, 3 Apr 2007 12:47:03 +0000 Subject: Neues Rescue-Programm angefangen --- qfixSoccerBoard.h | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 qfixSoccerBoard.h (limited to 'qfixSoccerBoard.h') diff --git a/qfixSoccerBoard.h b/qfixSoccerBoard.h new file mode 100644 index 0000000..9278504 --- /dev/null +++ b/qfixSoccerBoard.h @@ -0,0 +1,101 @@ +#include + + +#ifndef qfixSoccerBoard_h +#define qfixSoccerBoard_h + + +/** +* \class SoccerBoard +* \brief Represents the controller board "SoccerBoard". +* \author Stefan Enderle +* +* The class SoccerBoard represents the +* physical SoccerBoard with all its inputs and outputs. +* With this class it is possible to drive the motors, +* put on LEDs, check the buttons and get data from the +* analog and digital inputs. +*/ + +class SoccerBoard +{ + +public: + /** Constructor for the SoccerBoard class. + */ + SoccerBoard(); + + /** Puts on LED i. i must be 0 or 1. + */ + void ledOn(int i); + + /** Puts off LED i. i must be 0 or 1. + */ + void ledOff(int i); + + /** Puts off all LEDs. + */ + void ledsOff(); + + /** Puts LED i on if state is true, else off. i must be 0 or 1. + */ + void led(int i, bool state); + + /** Puts the power output i on + */ + void powerOn(int i); + + /** Puts the power output i off + */ + void powerOff(int i); + + /** Puts the power output i on if state is true, else off. + */ + void power(int i, bool state); + + /** Checks the state of button i. If it is pressed, true is returned, + * else false. + */ + bool button(int i); + + /** Uses the four LEDs on the board to display the value i + * with 0 <= i <= 255 + */ + void ledMeter(int i,int maxvalue); + + /** Sets motor i to the given speed. -255 <= speed <= 255. + */ + void motor(int i, int speed); + + void stop(int i); + + /** Puts off all motors. + */ + void motorsOff(); + + /** returns the value of the analog port i. 0 <= value <= 255. + */ + int analog(int i); + + /** returns true if the digital port is logical high, else false. + */ + bool digital(int i); + + /** Waits until button i is pressed and released again. + */ + void waitForButton(int i); + + void beep(int freq); + void beep(int freq, long msecs); + void beepOff(); + + void setTimer(unsigned long msecs); + bool timer(); + + void sleep(unsigned long msecs); +}; + + +void initTimer(); + +#endif -- cgit v1.2.3