Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed ADS1115 StepperMotor SRF05 TPA81new
Uvtron.cpp
00001 #include "Uvtron.h" 00002 00003 Uvtron::Uvtron(PinName a) : _a(a) 00004 { 00005 Counter=0; 00006 PrevCounter=0; 00007 NextCounter=0; 00008 Flag=0; 00009 _a.mode(OpenDrain); 00010 _a.rise(this, &Uvtron::Count); 00011 } 00012 00013 void Uvtron::Count() 00014 { 00015 Counter++; 00016 } 00017 00018 void Uvtron::Read() 00019 { 00020 00021 PrevCounter = NextCounter; 00022 NextCounter = Counter; 00023 00024 00025 if(NextCounter>(PrevCounter+1)&&Flag==0) 00026 { 00027 Flag=1; 00028 Counter=0; 00029 } 00030 else if (NextCounter==PrevCounter&&Flag==1) 00031 { 00032 Flag=0; 00033 } 00034 } 00035 00036 void Uvtron::UVScan() 00037 { 00038 PrevCounter = NextCounter; 00039 NextCounter = Counter; 00040 00041 if((NextCounter>PrevCounter) && (FlagScan==0)){ 00042 FlagScan = 1; 00043 Counter = 0; 00044 } 00045 else{ 00046 //FlagScan = 0; 00047 } 00048 } 00049 00050 00051
Generated on Wed Jul 13 2022 00:38:51 by
1.7.2