برگزیده های پرشین تولز

کد برای PIC16F84A

GHAHRAMANI

کاربر تازه وارد
تاریخ عضویت
3 می 2005
نوشته‌ها
78
لایک‌ها
0
سن
45
محل سکونت
DirtLand
سلام دوستان من یه کد برای ساعت چرخنده روی هوا نوشتم که میخوام کامپتیلش کنم یه چند تا ارور می ده با پیک بیسک پرو هم هستش میزارم اینجا تا هم استفاده کنین هم بگین ایرادش چیه تا من هم استفاده کنم اگه ایرادش بر طرف شد بگین تا مدارش رو هم بزارم.
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 2007/03/08 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
trisb = 0
trisa = %00001
b0 var byte : b1 var byte : b2 var byte : b3 var byte : b4 var byte
b5 var byte : b6 var byte : b7 var byte : b8 var byte : c0 var byte
c1 var word : n0 var word : T0 var word: T1 var word : T2 var word :n var word
b6=b3=t0=n0=b0=b4=b5=b7=b8=0
portb = 0
porta.4 = 0

set :
if porta.1=0 then b6=b6+1
toggle portb.0
end if
if porta.0=0 then b3=b3+1
toggle portb.0
end if
if b3=60 then b3=0
if b6=6=24 then b6=0
if porta.2=0 then goto takhir
pause 400
goto set
takhir:
for co=1 to 10
pause 1000 : portb = 0
next co

calibration :
porta.4=1
if porta.3<>0 then goto T
goto calibration

T:
T0=T0+1
pauses 2
if porta.3<>0 then goto Time
goto T

Time:
porta.4=0
T0=T0*2
T1=T0/3
T2=T1/50
n=1000000/T1

sycle :
n0=n0+1
n=n-1
if n<1 then goto main
goto sycle

main:
for b0=1 to 59
b1=b0 dig 0
b2=b0 dig 1
for c1= 1 to n0
if b8=0 then gosub a0
if b8=1 then gosub a1
if b8=2 then gosub a2
gosub space
if b7=9 then gosub a9
if b7=8 then gosub a8
if b7=7 then gosub a7
if b7=6 then gosub a6
if b7=5 then gosub a5
if b7=4 then gosub a4
if b7=3 then gosub a3
if b7=2 then gosub a2
if b7=1 then gosub a1
if b7=0 then gosub a0
gosub space
gosub F
gosub spce
if b5=5 then gosub a5
if b5=4 then gosub a4
if b5=3 then gosub a3
if b5=2 then gosub a2
if b5=1 then gosub a1
if b5=0 then gosub a0
gosub space
if b4=9 then gosub a9
if b4=8 then gosub a8
if b4=7 then gosub a7
if b4=6 then gosub a6
if b4=5 then gosub a5
if b4=4 then gosub a4
if b4=3 then gosub a3
if b4=2 then gosub a2
if b4=1 then gosub a1
if b4=0 then gosub a0
gosub space
gosub F
gosub space
if b2=5 then gosub a5
if b2=4 then gosub a4
if b2=3 then gosub a3
if b2=2 then gosub a2
if b2=1 then gosub a1
if b2=0 then gosub a0
gosub space
if b1=9 then gosub a9
if b1=8 then gosub a8
if b2=7 then gosub a7
if b2=6 then gosub a6
if b2=5 then gosub a5
if b2=4 then gosub a4
if b2=3 then gosub a3
if b2=2 then gosub a2
if b2=1 then gosub a1
if b2=0 then gosub a0
portb=0
pauses 4*T2
next c1
next b0
b3=b3+1
if b3=60 then b6=b6+1
b3=0
end if
if b6=24 then b6=0
b4=b3 dig 0
b5=b3 dig 1
b7=b6 dig 0
b8=b6 dig 1
goto main
a0 :
portb=%01111100
pauseus T2
portb=%10000010
pauseus 3*T2
portb=%01111100
pauseus T2
return
a1 :
pauseus 2*T2
portb=%00001000
pauseus T2
portb=%00000100
pauses T2
portb=1
pauseus T2
return
a2:
portb=%11110010
pauseus T2
portb=%10010010
pauseus 3*T2
portb=%10011110
pauseus T2
return

a3:
portb=%10010010
pauses 4*T2
portb=1
pauseus T2
return

a4:
portb=%00011110
pauseus T2
portb=%00010000
pauseus 2*t2
portb=1
pauseus T2
portb=%00010000
pauseus T2
return

a5:
portb=%10011110
pauseus T2
portb=10010010
pauseus 3*T2
portb=%11110010
pauseus T2
return

a6:
portb=1
pauseus T2
portb=%10010010
pauseus 3*t2
portb=%11110010
pauseus T2
return

a7:
portb=%00000110
pauseus T2
portb=%00000010
pauseus 3*T2
portb=1
pauseus T2
return

a8:
portb=1
pauseus T2
portb=%10010010
pauseus 3*T2
portb=1
pauseus T2
return

a9:
portb=%10011110
pauseus T2
portb=%10010010
pauseus 3*T2
portb=1
pauseus T2
return
space:
portb=0
pauseus 2*t2
return
F:
portb=%00101000
pauseus T2
return

End






 
بالا