Cześć
Jak zrobić pomiar temperatury ujemnej na LM75A według dokumentacji może mierzyć od - 55 do +125 C.
Mój kod na temp 0 - 125 C
Pozdrawiam Marcin!
Jak zrobić pomiar temperatury ujemnej na LM75A według dokumentacji może mierzyć od - 55 do +125 C.
Mój kod na temp 0 - 125 C
$regfile = "m8def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5
Config Scl = Portb.0
Config Sda = Portb.1
Config I2cdelay = 150
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim Lm75write As Byte
Dim Lm75read As Byte
Cursor Off
Deflcdchar 0 , 15 , 9 , 9 , 15 , 32 , 32 , 32 , 32
Lm75write = &B10010000
Lm75read = &B10010001
Do
I2cstart
I2cwbyte Lm75read
I2crbyte A , Ack
I2crbyte B , Nack
I2cstop
If B.7 = 0 Then
Cls
Lcd "Temp= " ; A ; ",0" ; Chr(0) ; "C"
End If
If B.7 = 1 Then
Cls
Lcd "Temp= " ; A ; ",5" ; Chr(0) ; "C"
End If
Waitms 100
Loop
EndPozdrawiam Marcin!
