One Wire Hub Test
One Wire Hub Test
#include "OneWireHub.h"
bool blinking()
{
constexpr uint32_t interval = 500; // interval at which to blink
(milliseconds)
static uint32_t nextMillis = millis(); // will store next time LED will
updated
void setup()
{
//Serial.begin(115200);
Serial.println("OneWire-Hub Test with various Sensors");
pinMode(pin_led, OUTPUT);
// Setup OneWire
ds1822.setTemperature(21.0f);
ds18S20.setTemperature(10.0f);
hub.attach(ds1822);
hub.attach(ds18B20);
hub.attach(ds18S20);
hub.attach(ds2401a);
hub.attach(ds2405);
//hub.attach(ds2401b);
hub.attach(ds2413);
hub.attach(ds2438);
//hub.attach(ds2450);
hub.attach(ds2890A);
//hub.attach(ds2890B);
//hub.attach(ds2890C);
Serial.println("config done");
}
void loop()
{
// following function must be called periodically
hub.poll();
// DS2450
static uint16_t p1, p2, p3, p4;
p1 +=1;
p2 +=2;
p3 +=4;
p4 +=8;
ds2450.setPotentiometer(p1,p2,p3,p4);
}
}