#ifndef _s0_h #define _s0_h #include "powerserial.h" class S0Class { static const unsigned int RESYNC = 5200; static const unsigned int PULSEMS = 50; static const int PULSEFACTOR = 10; unsigned long count; enum State {INIT, START, SYNC} state; unsigned long ms, kwh, fromnet, intonet, pulsems; int pulses; unsigned int msdelta; boolean high; uint8_t pin; public: void begin (uint8_t _pin); void tick (); }; extern S0Class S0; #endif // _s0_h