2016-02-24 21:51:16 +01:00
|
|
|
#include "HardwarePhotocell.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-02-24 21:51:16 +01:00
|
|
|
void HardwarePhotocell::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-02-24 21:51:16 +01:00
|
|
|
unsigned int HardwarePhotocell::getConsumption()
|
2016-02-24 14:37:48 +01:00
|
|
|
{
|
|
|
|
|
return pulse;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 21:51:16 +01:00
|
|
|
void HardwarePhotocell::reset()
|
2016-02-24 14:37:48 +01:00
|
|
|
{
|
|
|
|
|
pulse = 0;
|
|
|
|
|
}
|