Projects/HotTubTemp: Difference between revisions

From Hackerspace Amersfoort
Jump to navigation Jump to search
(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...")
ย 
No edit summary
Line 7: Line 7:


[picture]
[picture]
==Firmware Setup==
cp -r firmware/python_modules/sha2017/onewire firmware/python_modules/campzone2019/


==Software==
==Software==

Revision as of 20:39, 4 July 2021

Hardware

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

[picture]

Firmware Setup

cp -r firmware/python_modules/sha2017/onewire firmware/python_modules/campzone2019/

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)