![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
tes ir atas semua
Dependencies: mbed ADS1115 StepperMotor SRF05 TPA81new
Uvtron/Uvtron.cpp
- Committer:
- hisyamfs
- Date:
- 2019-03-06
- Revision:
- 49:d23d76689933
- Parent:
- 12:1e3227a6fcd7
File content as of revision 49:d23d76689933:
#include "Uvtron.h" Uvtron::Uvtron(PinName a) : _a(a) { Counter=0; PrevCounter=0; NextCounter=0; Flag=0; _a.mode(OpenDrain); _a.rise(this, &Uvtron::Count); } void Uvtron::Count() { Counter++; } void Uvtron::Read() { PrevCounter = NextCounter; NextCounter = Counter; if(NextCounter>(PrevCounter+1)&&Flag==0) { Flag=1; Counter=0; } else if (NextCounter==PrevCounter&&Flag==1) { Flag=0; } } void Uvtron::UVScan() { PrevCounter = NextCounter; NextCounter = Counter; if((NextCounter>PrevCounter) && (FlagScan==0)){ FlagScan = 1; Counter = 0; } else{ //FlagScan = 0; } }