makoto abe / Mbed 2 deprecated geigercounter04

Dependencies:   Terminal EthernetNetIf Pachube TextLCD mbed ConfigFile FirmwareUpdater

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers geigercounter.cpp Source File

geigercounter.cpp

00001 #include "geigercounter.h"
00002 
00003 
00004 
00005 float Geigercounter::getcps()
00006 {
00007     if(_geigerrun)_stoptime=time(NULL);
00008     int seconds=_stoptime-_starttime;
00009     float cps=(float)_count/(float)seconds;
00010     return cps;
00011 }
00012 
00013 float Geigercounter::getcpm()
00014 {
00015   return this->getcps()*60.0;
00016 }