26 lines
513 B
C++
26 lines
513 B
C++
#include "ExposureTimer.h"
|
|
#include <EEPROM.h>
|
|
|
|
unsigned int ExposureTime = 0;
|
|
unsigned long ExposureTimerStart = 0;
|
|
|
|
void ResetExposureTime()
|
|
{
|
|
EEPROM.get(0, ExposureTime);
|
|
}
|
|
|
|
|
|
void StartExposureTimer(unsigned long currentTime)
|
|
{
|
|
EEPROM.put(0, ExposureTime);
|
|
ExposureTimerStart = currentTime;
|
|
}
|
|
|
|
|
|
String FormatTime(unsigned int Time)
|
|
{
|
|
String minutes = String(ExposureTime / 60);
|
|
String seconds = String(ExposureTime % 60);
|
|
|
|
return minutes + ':' + (seconds.length() == 1 ? '0' + seconds : seconds);
|
|
} |