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: SoftSerial SDFileSystem mbed wave_player
Diff: Relay.h
- Revision:
- 24:d91e9b3b5bd5
- Child:
- 29:c2d95d88ee0b
diff -r 121e3235ccfa -r d91e9b3b5bd5 Relay.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Relay.h Wed May 17 00:10:42 2017 +0200
@@ -0,0 +1,34 @@
+//
+// Created by thoma on 16-May-17.
+//
+
+#ifndef VISIBLE_LIGHT_COMMUNICATION_RELAY_H
+#define VISIBLE_LIGHT_COMMUNICATION_RELAY_H
+
+
+#include "mbed.h"
+#include "MySoftSerial.h"
+
+class Relay {
+public:
+ Relay(PinName tx_luart, int baudrate_luart, PinName tx_usb, PinName rx_usb, int baudrate_usb);
+ void run();
+
+private:
+ MySoftSerial softSerial;
+ Serial usb;
+
+ static const int SEND_FILE = 0b00001111;
+ static const int SET_VOLUME = 0b00110011;
+ static const int ACK = 0b11111111;
+ int buffer[64];
+
+ void handle_type();
+
+ void set_volume();
+
+ void send_file();
+};
+
+
+#endif //VISIBLE_LIGHT_COMMUNICATION_RELAY_H