I have a automation hat and a SCD41 and i am wanting to learn how to use the sensors data to control the output relays. I.e. temperature is less than 20°C turn on relay 1 to turn on a heater. Could anyone point me in the right direction to some resources where i can learn how to do it? Cheers, Brad
Have you found the Automation HAT tutorial? That shows you how to turn the relays on and off, so then it should just be a question of incorporating some code to read the sensor and popping it into an if statement - something like
while True:
co2, temperature, relative_humidity, timestamp = device.measure()
if temperature < 20:
automationhat.relay.one.on()
else:
automationhat.relay.one.off()
Thank you Hel. I have read the tutorial but wasnt certain how to incorporate the sensor data. I am very new to this sorry.