Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $regfile = "m8def.dat"
  2. $crystal = 8000000
  3. $hwstack = 40
  4. $swstack = 16
  5. $framesize = 32
  6.  
  7. Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portb.1 , E = Portc.1 , Rs = Portc.0
  8. Config Lcd = 16 * 2
  9.  
  10. Config Adc = Single , Prescaler = Auto , Reference = Avcc
  11. Start Adc
  12.  
  13. Dim Temp As Integer
  14. Dim Converted As Single
  15. Dim Text As String * 10
  16.  
  17.  
  18. Do
  19.    Temp = Getadc(5)
  20.    Converted = Temp * 4.2
  21.    Converted = Converted / 1024
  22.    Converted = Converted - 0.5
  23.    Converted = Converted * 100
  24.  
  25.    Text = Fusing(converted , "#.##")
  26.  
  27.  
  28.    Cls
  29.    Lcd Text
  30.    Wait 1
  31. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement