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: battery.cpp
- Revision:
- 1:c2232b1eaf31
diff -r c0f34d23943d -r c2232b1eaf31 battery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/battery.cpp Sun Jan 24 16:15:53 2016 +0000 @@ -0,0 +1,43 @@ +/** +* All the code associated to run the mbed as a battery. +* Link with locker +*/ +#include "mbed.h" +#include "utils.h" +#define debug + +// Flags +// Variables +// tx nRF2401 + +long long addrLocker=0xBBBBBBBBBB; +extern int channel; + +// Initializaton +/** +* Initialise for a battery +* fp is the config file if additonal information is needed. +*/ +void initialiseBattery(FILE *fp){ +#ifdef debug + printf("Initialise Battery\n\r"); +#endif + + // Read in hub address and channel + if (fscanf (fp,"%x %*c %*s",&channel )!=1) writeError("Battery config: cannot read channel"); + if (fscanf (fp,"%llx %*c %*s",&addrLocker )!=1) writeError("Battery config: cannot read address"); + +#ifdef debug + printf(" Channel:%x, Address %llx \n\r",channel, addrLocker); +#endif + + +} +// Interupt routines + + +// Loop through slow routines + +void loopBattery(){ + +} \ No newline at end of file