۰۹-مرداد-۱۳۹۱, ۲۱:۱۰:۳۹
با درود به همه عزیزان
درباره برنامه خواندن دما از سنسور دمای smt160 که در وبسایت یزدکیت گذاشته یه سوال دارم .
در قسمتی از برنامه به اندازه سه پالس تاخیر با دستور bitwait داده شده دلیلش رو میخواستم بدونم:
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
کل برنامه :
درباره برنامه خواندن دما از سنسور دمای smt160 که در وبسایت یزدکیت گذاشته یه سوال دارم .
در قسمتی از برنامه به اندازه سه پالس تاخیر با دستور bitwait داده شده دلیلش رو میخواستم بدونم:
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
کل برنامه :
کد:
Do
Gosub Read_data_sm160
Locate 1 , 1
Lcd "T= " ; _temp ; "c ";
Wait 1
Loop
End
'-------------------------------------------------------------------------------
[color=red]Read_data_sm160:
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset
Bitwait Pind.2 , Set
Bitwait Pind.2 , Reset[/color]
Stop Timer1
Bitwait Pind.2 , Set
Timer1 = 0
Start Timer1
Bitwait Pind.2 , Reset
'Xl = Timer1
Yazdkit_set = Timer1
Timer1 = 0
Start Timer1
Bitwait Pind.2 , Set
'Xf = Timer1
Yazdkit_reset = Timer1
X = Yazdkit_set + Yazdkit_reset
Duty = Yazdkit_set / X
Duty = Duty - 0.32
Waitms 1
Temp = Duty / 0.0047
Waitms 1
Locate 1 , 1
_temp = Fusing(temp , "#.##")
Stop Timer1
Return