Some small updates
This commit is contained in:
parent
df6feb5597
commit
5f0800897c
5 changed files with 22 additions and 14 deletions
|
|
@ -1,18 +1,20 @@
|
|||
#include "SensorPhotocell.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
void SensorPhotocell::interruptHandler()
|
||||
{
|
||||
++pulse;
|
||||
}
|
||||
|
||||
|
||||
void SensorPhotocell::setup()
|
||||
{
|
||||
Interrupt::setCallback(SensorPhotocell::interruptHandler);
|
||||
Interrupt::setupPinInterrupt(PC2); //PC3
|
||||
}
|
||||
|
||||
void SensorPhotocell::read(PowerData& data)
|
||||
{
|
||||
data.consumption = pulse;
|
||||
}
|
||||
|
||||
void SensorPhotocell::reset()
|
||||
{
|
||||
pulse = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue