You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • "single bus" is NOT the same as OneWire!!!

    OneWire is a specific protocol used almost exclusively by Dallas Semiconductor products. The slave devices all have a unique serial number, there's a way to parasite power so you don't need a separate power wire, etc. The Aosong temperature/humidity sensors do not use OneWire, they use their own single wire protocol; calling it a bus is misuse of that term, IMO, as well - "bus" sort of implies that more than two devices can be connected to it - but with no provision for addressing, the single wire protocol that the Aosong sensors use can only ever have two devices connected to it - the sensor, and the controller it talks to (I mean, I guess you could have multiple controllers connected to it, but I still don't think this counts!).

    But yeah, it looks like you can talk to that as if it's an AM2302 (aka DHT22) if you ground the SCL pin. An I2C module for those would be nice though - reading the single wire protocol in javascript doesn't play to Espruino's strengths.... Like, it works, but behind the scenes it's generating IIRC 80 callbacks within just a few milliseconds. An I2C module for it wouldn't be hard to write either...

About

Avatar for DrAzzy @DrAzzy started