Elektrik-Elektronik notları internet ortamındaki elektrik- elektronik formlarından alınmıştır. Notlar ticari olarak değil yardımcı not olarak kullanılmak üzere paylaşılmıştır.
9 Nisan 2012 Pazartesi
Program4
'16f877 nin c3 portunda bulunan butona basılıp çekilince
'c2 portundaki bulunan ledi yakan, c4 portunda bulunan butona
'basılıp çekilince c5 portunda bulunan ledi yakan
'program proton dilinde yazınız ?
Device=16F877A
XTAL=20
ADCON1=7
TRISA=0:TRISB=0:TRISC=011000:TRISD=0:TRISE=0
Dim buton1 As PORTC.3
Dim sepet1 As Bit
Dim led1 As PORTC.2
Dim buton2 As PORTC.4
Dim sepet2 As Bit
Dim led2 As PORTC.5
PORTA=0:PORTB=0:PORTC=0:PORTD=0:PORTE=0
sepet1=0:sepet2=0
basla:
If buton1=1 Then GoSub led1yak
If buton2=1 Then GoSub led2yak
GoTo basla
led1yak:
dur1:
If buton1=1 Then GoTo dur1
sepet1=0
If sepet1=0 Then
led1=1 : DelayMS 200
sepet1=1 : DelayMS 200
Else
led1=0 : DelayMS 200
sepet1=0 : DelayMS 200
EndIf
Return
led2yak:
dur2:
If buton2=1 Then GoTo dur2
sepet2=0
If sepet2=0 Then
led2=1 : DelayMS 200
sepet2=1 : DelayMS 200
Else
led2=0 : DelayMS 200
sepet2=0 : DelayMS 200
EndIf
Return
End
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder