hal/arduino/HalMultiSensor/SensorPhotocell.cpp
2016-05-26 16:35:22 +02:00

20 lines
350 B
C++
Executable file

#include "SensorPhotocell.h"
#include <Arduino.h>
void SensorPhotocell::interruptHandler()
{
++pulse;
}
void SensorPhotocell::setup()
{
Interrupt::setPinCallback(SensorPhotocell::interruptHandler);
Interrupt::setupPinInterrupt(PC2); //PC3
}
void SensorPhotocell::read(PowerData& data)
{
data.consumption = pulse;
pulse = 0;
}