working version of song control with initialization from sd card
Dependencies: MFRC522 NRF2401P SDFileSystem SPI_TFT_ILI9341 TFT_fonts mbed
Fork of Song_Control by
Diff: main.cpp
- Revision:
- 2:d1eae91343a9
- Parent:
- 1:c2232b1eaf31
--- a/main.cpp Sun Jan 24 16:15:53 2016 +0000 +++ b/main.cpp Thu Jan 28 14:38:45 2016 +0000 @@ -6,6 +6,7 @@ */ #include "mbed.h" #include "SDFileSystem.h" +#include "NRF2401P.h" #include "utils.h" #include "battery.h" #include "hub.h" @@ -19,11 +20,13 @@ unsigned int sdVersion; int id; int channel; +char txBuff[100]; // Sd card SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); - +// nrf +NRF2401P nrf1(PTD6,PTD7, PTD5,PTD4, PTC12); //mosi, miso, sclk, csn, ce) /** * Reads config file and configures the mbed */ @@ -62,7 +65,7 @@ break; } case('H'): { // Hub - //initialiseHub(fp); + initialiseHub(fp); break; } case('L'): { // Locker @@ -74,9 +77,9 @@ break; } default:{ - writeError ("Type declared in config not available."); - } - + writeError ("Type declared in config not available."); + } + } fclose (fp); } @@ -100,6 +103,27 @@ #endif while (true) { // do slower routines + switch (role){ + case('B'): { // Battery + loopBattery(); + break; + } + case('H'): { // Hub + loopHub(); + break; + } + case('L'): { // Locker + loopLocker(); + break; + } + case('T'): { // Test + loopTest(); + break; + } + default:{ + writeError ("Type declared in config not available."); + } + } } } \ No newline at end of file