bonnyr / wokwi-ds1820-custom-chip

MIT License
2 stars 3 forks source link

Multiple sensors? #22

Open drf5n opened 8 months ago

drf5n commented 8 months ago

Is this repository the documentation for the part on https://docs.wokwi.com/getting-started/supported-hardware ?

I was trying to use the DS18B20 Wokwi component as inserted by the UI and had some success, but if I connect multiple chips to the same port, it does not seem to work.

...As I type that out, I think I realize that the "not-circuit-simulator" part of Wokwi means that multiple use of a single pin might not work properly.

Do multiple sensors on a single One-Wire pin work? With the DS1820?

////// Yes they do. Example:

https://wokwi.com/projects/374187973650215937

It seems you have to set the deviceID attribute in the diagram.json file:

    {
      "type": "board-ds18b20",
      "id": "temp1",
      "top": -87.53,
      "left": 109.68,
      "attrs": { "deviceID": "111111111111" }
    },
    {
      "type": "board-ds18b20",
      "id": "temp2",
      "top": -87.53,
      "left": 157.68,
      "attrs": { "deviceID": "222222222222" }
    },
    {
      "type": "board-ds18b20",
      "id": "temp3",
      "top": -87.53,
      "left": 205.68,
      "attrs": { "deviceID": "333333333333" }
    },

Setting the device ID in the pop-up window doesn't appear to do anything.