Part One of my Project Course. Implementation of simple I/O and a custom defined protocol over UDP/IP.
Dependencies: C12832 LM75B mbed EthernetInterface mbed-rtos
main.cpp
- Committer:
- bertgereels
- Date:
- 2018-03-14
- Revision:
- 1:b5c534165dfe
- Parent:
- 0:88d3b9015f7c
- Child:
- 2:6bfe732ba6bc
File content as of revision 1:b5c534165dfe:
#include "mbed.h" #include "lcd.h" #include "buzzer_music.h" #include "rgb.h" #include "potentiometer.h" #include "temperature.h" #include "slave.h" #include "command.h" #include "master.h" #include "selection.h" using namespace ProjectOne; BusIn joy(p14); //enkel verticaal int main() { BuzzerMusic buzzerMusic; Temperature temperatureReader; Potentiometer potentiometerReader; RGB rgbLed; LCD lcdApplicationBoard; Selection selection; string mode; int id; mode = selection.determineMode(); printf("The mode you selected: '%s'\r\n", mode); id = selection.determineId(); printf("The id you selected is '%d'\r\n", id); if(mode == "slave"){ Slave slave(id, &temperatureReader,&potentiometerReader,&lcdApplicationBoard,&rgbLed,&buzzerMusic); while(true){ slave.handleIncomingFrame(); } } if(mode == "master"){ Master master(id); while(true){ master.handlePcData(); } } }