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.
Dependencies: mbed RemoteIR SuperTweet ConfigFile EthernetNetIf
Diff: mylib/MyHomeLight/MyHomeLight.h
- Revision:
- 0:db299c5a18ba
- Child:
- 1:c4cfd136f9c7
diff -r 000000000000 -r db299c5a18ba mylib/MyHomeLight/MyHomeLight.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mylib/MyHomeLight/MyHomeLight.h Fri Oct 29 23:17:01 2010 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+#include "TransmitterIR.h"
+
+class MyHomeLight {
+public:
+
+ /**
+ * Create.
+ *
+ * @param tx_pin Pin of IR transmitter.
+ */
+ explicit MyHomeLight(PinName tx_pin);
+
+ /**
+ * Dispose.
+ */
+ ~MyHomeLight();
+
+ /**
+ * Toggle state.
+ *
+ * @param channel Target channel number.
+ * @return true if it succeed.
+ */
+ bool toggle(const int channel);
+
+private:
+ TransmitterIR tx;
+
+ typedef struct {
+ int channel; /**< Channel number. */
+ char *signal; /**< Signal data. */
+ } light_signal_t;
+
+ /**
+ * Signal for a light.
+ */
+ static const light_signal_t lights[8];
+
+ /**
+ * Get a signal for a light.
+ *
+ * @param channel Channel of a light.
+ *
+ * @return A pointer to a signal.
+ */
+ uint8_t *getLightSignal(int channel);
+};