This is a example application for StarBoard Orange designed by @logic_star. This example can be drive a CHORO Q HYBRID.
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