00001 #include "LCDTimeSensor.h" 00002 00003 #include <sys/types.h> 00004 #include <time.h> 00005 #include <unistd.h> 00006 #include <string> 00007 00008 using namespace std; 00009 00010 LCDTimeSensor::LCDTimeSensor(const string &format) 00011 { 00012 _format = format; 00013 } 00014 00015 void LCDTimeSensor::waitForChange() 00016 { 00017 sleep(1); 00018 } 00019 00020 string LCDTimeSensor::getCurrentValue() 00021 { 00022 return executeCommand("date " + _format); 00023 }