Hello new to this but im just not getting it, im building a digital thermometer and humidity display. im currently using a 28x2 driving many 4511b latch decoders to drive the 4 digit 7 seg displays there are 4,
so i have worked out a nice circuit that displays the value of b1 on the leds, looks nice.
OK so my real issue is the sensor the last project i built used the DS18B20 Digital Temperature sensor, that was nice and easy, but with my new project i thought i would try and use the HTU21D temperature humidity sensor module which uses I2C ,
ive been trying to get some code to work but its just not happening.
Code:
SYMBOL SensorRH = W0
SYMBOL Temperature = W1
' Implementation of HTU21D temperature and humidity sensor with Picaxe 18m2. RH and Temp update ~every 2 sec.
Main:
Pause 20
hi2csetup i2cmaster,0x80,i2cslow_8,i2cbyte '%10000000 (hex 0x80) is device i2c bus address
hi2cin 0xE5, (b1,b0) '%11100101 to trigger humidity measurement, store in b1, b0 (automatically combined to w0)
hi2cin 0xE3, (b3,b2) '%11100011 to trigger temperature measurement, store in b3, b2 (automatically combined to w1)
pause 20
debug
goto main
of course i nicked the code from this site, sorry, but the irony is of course is i dont really know whats going on.
All i was hoping to do is have say w0 display humidity and w1 to show temp, or at least some numbers i could play with and display,
what does hi2cin 0xE5 actually mean is that making a pin go high ?
is it possible this code is not right for the 28x2???
any help would be great, i try to get as far as i can by myself but sometimes.... regards twimc
so i have worked out a nice circuit that displays the value of b1 on the leds, looks nice.
OK so my real issue is the sensor the last project i built used the DS18B20 Digital Temperature sensor, that was nice and easy, but with my new project i thought i would try and use the HTU21D temperature humidity sensor module which uses I2C ,
ive been trying to get some code to work but its just not happening.
Code:
SYMBOL SensorRH = W0
SYMBOL Temperature = W1
' Implementation of HTU21D temperature and humidity sensor with Picaxe 18m2. RH and Temp update ~every 2 sec.
Main:
Pause 20
hi2csetup i2cmaster,0x80,i2cslow_8,i2cbyte '%10000000 (hex 0x80) is device i2c bus address
hi2cin 0xE5, (b1,b0) '%11100101 to trigger humidity measurement, store in b1, b0 (automatically combined to w0)
hi2cin 0xE3, (b3,b2) '%11100011 to trigger temperature measurement, store in b3, b2 (automatically combined to w1)
pause 20
debug
goto main
of course i nicked the code from this site, sorry, but the irony is of course is i dont really know whats going on.
All i was hoping to do is have say w0 display humidity and w1 to show temp, or at least some numbers i could play with and display,
what does hi2cin 0xE5 actually mean is that making a pin go high ?
is it possible this code is not right for the 28x2???
any help would be great, i try to get as far as i can by myself but sometimes.... regards twimc