combined sourcode for mostly esp8266 sensor iot nodes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
514 B

#ifndef SENSOR_HCSR501_H
#define SENSOR_HCSR501_H
#include "sensordata.h"
#include <Homie.h>
class Sensor_HCSR501
HomieNode *sensorNode; //reference to HomieNode
int hcsr501pin;
struct sensordata data; //struct values are changed in setup()
bool init_ok;
Sensor_HCSR501(int pin);
void init();
void setSettings(unsigned long senddelaymax, unsigned long readdelay);
void advertise(HomieNode& p_sensorNode);
void sensorloop();