bmandl
Full Member level 4
Hello everyone!
Have anybody heard of this temperature and humidity sensor, which has three different names and uses some kind of 1-wire communication, which has nothing in common with Dallas 1-wire? I wanted to find some C code example for it (AVR or PIC), but all I can find is Arduino and C++ examples. I get to thinking, that this sensor is only usable with C++ language? I will try to write a C code for AVR or PIC microcontroller, but I don't understand a few things. I was thinking, if someone could explain this to me:
Datasheet, page 4: It says, that if sensor outputs positive signal for 26-28us, this means logic "0", but if it outputs positive signal for 70us, it means logic "1".
If this is so, I must measure time, for how long positive signal from sensor was present and then determine if it was "0" or "1"? Very strange way to separate two logic states is it not?
Ok, if someone could answer me to this questions please, I will be looking forward to start coding interface between sensor and microcontroller.
Regards!
Have anybody heard of this temperature and humidity sensor, which has three different names and uses some kind of 1-wire communication, which has nothing in common with Dallas 1-wire? I wanted to find some C code example for it (AVR or PIC), but all I can find is Arduino and C++ examples. I get to thinking, that this sensor is only usable with C++ language? I will try to write a C code for AVR or PIC microcontroller, but I don't understand a few things. I was thinking, if someone could explain this to me:
Datasheet, page 4: It says, that if sensor outputs positive signal for 26-28us, this means logic "0", but if it outputs positive signal for 70us, it means logic "1".
If this is so, I must measure time, for how long positive signal from sensor was present and then determine if it was "0" or "1"? Very strange way to separate two logic states is it not?
Ok, if someone could answer me to this questions please, I will be looking forward to start coding interface between sensor and microcontroller.
Regards!