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
Relay.h
- Committer:
- Desertification
- Date:
- 2017-05-17
- Revision:
- 29:c2d95d88ee0b
- Parent:
- 24:d91e9b3b5bd5
File content as of revision 29:c2d95d88ee0b:
// // 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 PLAY_LAST = 0b10001011; static const int ACK = 0b11111111; int buffer[512]; void handle_type(); void set_volume(); void send_file(); void play_last(); }; #endif //VISIBLE_LIGHT_COMMUNICATION_RELAY_H