2016-05-02 10:56:15 +02:00
|
|
|
#include "SensorPhotocell.h"
|
2016-02-24 14:37:48 +01:00
|
|
|
|
|
|
|
|
|
2016-02-24 21:51:16 +01:00
|
|
|
void pinInterrupt()
|
2016-02-24 14:37:48 +01:00
|
|
|
{
|
2016-02-24 21:51:16 +01:00
|
|
|
//++pulse;
|
2016-02-24 14:37:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2016-05-02 10:56:15 +02:00
|
|
|
void SensorPhotocell::setup()
|
2016-02-24 14:37:48 +01:00
|
|
|
{
|
2016-02-24 21:51:16 +01:00
|
|
|
interrupt = new Interrupt(pinInterrupt);
|
|
|
|
|
interrupt->setupPinInterrupt(PC2); //PC3
|
2016-02-24 14:37:48 +01:00
|
|
|
}
|
|
|
|
|
|
2016-05-02 10:56:15 +02:00
|
|
|
unsigned int SensorPhotocell::getConsumption()
|
2016-02-24 14:37:48 +01:00
|
|
|
{
|
|
|
|
|
return pulse;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-02 10:56:15 +02:00
|
|
|
void SensorPhotocell::reset()
|
2016-02-24 14:37:48 +01:00
|
|
|
{
|
|
|
|
|
pulse = 0;
|
|
|
|
|
}
|