سلام به دوستان عزیز ...
دوستان میتونید این کد بیسکام رو برام تحلیل کنید ....فقط خیلی زود میخوام تحلیلشو ...
دوستان میتونید این کد بیسکام رو برام تحلیل کنید ....فقط خیلی زود میخوام تحلیلشو ...
کد:
$regfile = "m16def.dat" $crystal = 8000000 '--------------- Config Lcdpin = Pin , Db4 = Portb.3 , Db5 = Portb.2 , Db6 = Portb.1 , Db7 = Portb.0 , E = Portb.4 , Rs = Portb.5 Config Lcd = 16 * 2 Config Adc = Single , Prescaler = Auto , Reference = Avcc Config Portb = Output Config Portc = Input 'Config Portd = Output '************************************************************************** '************************************************************************** Dim A As Byte
کد:
Dim B As Word
Dim C As Integer
Dim Hight As Integer
Dim Weight As Long
Dim Bmi As Long
Dim H2 As Long
Dim Loop1 As Byte
Dim Zero_set As Integer
Dim Span_set As Integer
Config Kbd = Portd , Debounce = 100 , Delay = 100
'-------------------------------------------------
Cls
Lcd "HELLO"
Wait 1
Cls
Do
Zero_set = 450
Span_set = 290
Hight = 0
Cls
Lcd "Input Hight"
Loop1 = 1
While Loop1 = 1
A = Getkbd()
Waitms 100
If A < 16 Then
A = Lookup(a , Read_key)
End If
If A < 10 Then
If Hight < 150 Then
C = Hight * 10
Hight = A + C
Cls
Lcd "Hight="
Lcd Hight
Lcd " cm"
End If
End If
If A = 15 Then
Loop1 = 0
End If
Wend
Waitms 500
Cls
Lcd "Input Weight"
Wait 1
Loop1 = 1
While Loop1 = 1
B = Getadc(0)
Weight = B - Zero_set
Weight = Weight * 110
Weight = Weight / Span_set
Cls
Lcd "weight="
Lcd Weight
Lcd " Kg"
Waitms 200
A = Getkbd()
A = Lookup(a , Read_key)
If A = 15 Then
Loop1 = 0
End If
Wend
Bmi = Weight * 10000
H2 = Hight * Hight
Bmi = Bmi / H2
Cls
Lcd "BMI="
Lcd Bmi
Wait 3
Loop
End
Read_key:
'Data 13 , 14 , 0 , 15 , 12 , 9 , 8 , 7 , 11 , 6 , 5 , 4 , 10 , 3 , 2 , 1
Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 11 , 1 , 2 , 3 , 12 , 15 , 0 , 13 , 14
' Data 1 , 4 , 7 , 15 , 2 , 5 , 8 , 0 , 3 , 6 , 9 , 14 , 10 , 11 , 12 , 13




دیدگاه