Advertisement
serikov

Working with DS18S20

Nov 13th, 2013
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Define 1WIRE_REG = PORTA
  2. Define 1WIRE_BIT = 2
  3.  
  4. Dim temp As Byte
  5. Dim sign As Byte
  6. Dim temp2 As Bit
  7.  
  8.  
  9. DS18S20Start
  10. WaitMs 1000
  11. DS18S20ReadT temp, sign
  12. Lcdcmdout LcdClear
  13. If sign > 0 Then
  14.     Lcdout "-"
  15.     temp = 255 - temp
  16.     temp = temp + 1
  17. Endif
  18. temp2 = temp.0
  19. temp = temp / 2
  20. Lcdout #temp
  21. If temp2 = 1 Then
  22.     Lcdout ".5"
  23. Else
  24.     Lcdout ".0"
  25. Endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement