Projects/HotTubTemp

From Hackerspace Amersfoort
Revision as of 20:37, 4 July 2021 by Eightdot (talk | contribs) (Created page with "==Hardware== *CampZone2019 badge 'I-PANE' *Waterproof DS18B20 with 1K5 pullup on expansion VCC,GND,SDA *Case *M12 Gland [picture] ==Software== <nowiki> import onewire...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Hardware

  • CampZone2019 badge 'I-PANE'
  • Waterproof DS18B20 with 1K5 pullup on expansion VCC,GND,SDA
  • Case
  • M12 Gland

[picture]

Software

import onewire

ds=onewire.ds18x20.DS18X20(onewire.OneWire(machine.Pin(4)))
roms=ds.scan()

def update():
  global ds
  global roms
  rgb.clear()
  rgb.text(str(system.get_vcc_bat()))
  time.sleep(0.5)
  ds.convert_temp()
  rgb.clear()
  rgb.text(str(ds.read_temp(roms[0]))[0:5])

while(1):
  update()
  time.sleep(10)