summaryrefslogtreecommitdiffstats
path: root/qfixSoccerBoard.h
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-04-03 14:47:03 +0200
committerneoraider <devnull@localhost>2007-04-03 14:47:03 +0200
commit98c623dc8969151c0872a2d102d486f9a735d614 (patch)
treec9746d588928c618c6687e719a910350f8c070b5 /qfixSoccerBoard.h
downloadrc2007-rescue-old-master.tar
rc2007-rescue-old-master.zip
Neues Rescue-Programm angefangenHEADmaster
Diffstat (limited to 'qfixSoccerBoard.h')
-rw-r--r--qfixSoccerBoard.h101
1 files changed, 101 insertions, 0 deletions
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 <qfix/qfix.h>
+
+
+#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