inital commit
This commit is contained in:
commit
51a5e6fc28
22
comperator.cpp
Normal file
22
comperator.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include "comperator.h"
|
||||
|
||||
Comperator::Comperator()
|
||||
{
|
||||
if constexpr(INTERNAL_REFERANCE) ACSR = 0b01000001;
|
||||
else ACSR = 0b00000011;
|
||||
}
|
||||
|
||||
void Comperator::on()
|
||||
{
|
||||
ACSR &= 0b01111111;
|
||||
}
|
||||
|
||||
void Comperator::off()
|
||||
{
|
||||
ACSR |= 0b10000000;
|
||||
}
|
||||
|
||||
bool Comperator::compare()
|
||||
{
|
||||
return ACSR & 0b00100000;
|
||||
}
|
Loading…
Reference in a new issue