Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: mylib/ChoroQ.h
- Revision:
- 0:127b9ca59547
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mylib/ChoroQ.h Tue Aug 24 11:58:09 2010 +0000
@@ -0,0 +1,60 @@
+#ifndef _CHORO_Q_H_
+#define _CHORO_Q_H_
+
+#include <mbed.h>
+#include <inttypes.h>
+#include <TransmitterIR.h>
+
+class ChoroQ {
+public:
+
+ typedef enum {
+ ChA,
+ ChB,
+ ChC,
+ ChD
+ } Channel;
+
+ ChoroQ(PinName pin, Channel ch);
+ ~ChoroQ();
+
+ typedef enum {
+ Undef,
+ Up,
+ Down,
+ Left,
+ Right,
+ UpDash,
+ UpLeft,
+ UpRight,
+ UpRightDash,
+ UpLeftDash,
+ DownLeft,
+ DownRight,
+ DownDash,
+ DownLeftDash,
+ DownRightDash,
+ Stop
+ } Action;
+
+ void execute(Action action);
+
+private:
+ typedef struct {
+ Action action;
+ char *command;
+ } action_t;
+
+ static const int CH_A = 0x00;
+ static const int CH_B = 0x02;
+ static const int CH_C = 0x01;
+ static const int CH_D = 0x03;
+ static const action_t list[];
+
+ TransmitterIR irtx;
+ int channel;
+
+ uint8_t *getCommand(Action action);
+};
+
+#endif