Some small updates

This commit is contained in:
Ziver Koc 2016-05-18 17:06:34 +02:00
parent df6feb5597
commit 5f0800897c
5 changed files with 22 additions and 14 deletions

View file

@ -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;
}
}