GY-63_MS5611/libraries/AnalogPin/AnalogPin.h

42 lines
658 B
C
Raw Normal View History

//
// FILE: AnalogPin.h
// AUTHOR: Rob Tillaart
2015-03-06 08:26:17 -05:00
// VERSION: 0.1.04
// DATE: 2014-10-05
// PURPOSE: wrapper class for analogRead
// URL:
//
// Released to the public domain
//
#ifndef AnalogPin_h
#define AnalogPin_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
2015-03-06 08:26:17 -05:00
#define ANALOGPIN_LIB_VERSION "0.1.04"
class AnalogPin
{
public:
2015-03-06 08:26:17 -05:00
AnalogPin(const uint8_t);
// noise 0..255; in practice 0..4
int read(uint8_t noise = 0);
// alpha 0..31;
int readSmoothed(uint8_t alpha = 0);
int readPrevious();
private:
uint8_t _pin;
int _prevValue;
};
#endif
// -- END OF FILE --