Soru 1:
i VAR BYTE
j VAR BYTE
TRISC=0
TRISB.0=1
PORTC=0
PORTB=0
'TAMAMI ÇIKIÞ
SYMBOL ANAHTAR=PORTB.0
KONTROL:
IF ANAHTAR=1 THEN GOSUB ILERI_SAY
IF ANAHTAR=0 THEN GOSUB GERI_SAY
GOTO KONTROL
ILERI_SAY:
FOR i=0 to 15
LOOKUP i ,[$3F, $06, $5B, $4F, $66, $6D, $7D, $07, $7F, $6F, $77, $7C, $39, $5E, $79, $71 ],
PORTC
pause 500
NEXT i
RETURN
GERI_SAY:
FOR j= 15 to 0 step -1
LOOKUP j ,[$3F, $06, $5B, $4F, $66, $6D, $7D, $07, $7F, $6F, $77, $7C, $39, $5E, $79, $71 ],
PORTC
pause 500
NEXT j
RETURN
END
Soru 2:
TRISB=0
TRISC=0
PORTB=0
PORTC=0
START:
PORTB.0=1
SOLA
PAUSE 250
PORTB=PORTB<<1
TOGGLE PORTC.0
IF PORTB.7=1 THEN GOTO SAGA
GOTO SOLA
SAGA
PAUSE 250
PORTB=PORTB>>1
TOGGLE PORTC.0
IF PORTB.0=1 THEN GOTO SOLA
GOTO SAGA
END
Soru 3:
i VAR BYTE
j VAR BYTE
TRISC=0
TRISB.0=1
PORTC=0
PORTB=0
'TAMAMI ÇIKIÞ
SYMBOL ANAHTAR=PORTB.0
KONTROL:
IF ANAHTAR=1 THEN GOSUB CIFTLERI_SAY
IF ANAHTAR=0 THEN GOSUB TEKLERI_SAY
GOTO KONTROL
CIFTLERI_SAY:
FOR i=0 TO 9 STEP 2
LOOKUP i ,[$3F, $06, $5B, $4F, $66, $6D, $7D, $07, $7F, $6F ], PORTC
pause 500
NEXT i
RETURN
TEKLERI_SAY:
FOR j= 1 TO 9 STEP 2
LOOKUP j ,[$3F, $06, $5B, $4F, $66, $6D, $7D, $07, $7F, $6F ], PORTC
pause 500
NEXT j
RETURN
END
Soru 4:
TRISB=0
TRISA=3
TEKRAR VAR BYTE
I VAR BYTE
BUTON1 VAR PORTA.0
BUTON2 VAR PORTA.1
PORTB=0
TEKRAR=0
ADCON1=7
KONTROL:
PORTC=0
IF BUTON1=0 THEN
TEKRAR=5
GOTO START
ENDIF
IF BUTON2=0 THEN
TEKRAR=10
GOTO START
ENDIF
GOTO KONTROL
START:
FOR I=0 TO TEKRAR
PORTB=1
SOLA
PAUSE 250
PORTB=PORTB<<1
IF PORTB.7=1 THEN GOTO SAGA
GOTO SOLA
SAGA
PAUSE 250
PORTB=PORTB>>1
IF PORTB.0=1 THEN GOTO BITTIMI
GOTO SAGA
BITTIMI:
NEXT I
TEKRAR=0
GOTO KONTROL
END
Soru 5:
TRISC=0
TRISB=0
TRISA=3
TEKRAR VAR BYTE
I VAR BYTE
BUTON1 VAR PORTA.0
BUTON2 VAR PORTA.1
PORTB=0
PORTC=0
TEKRAR=0
ADCON1=7
KONTROL:
PORTC=0
IF BUTON1=0 THEN
TEKRAR=2
GOTO START
ENDIF
IF BUTON2=0 THEN
TEKRAR=3
GOTO START
ENDIF
GOTO KONTROL
START:
FOR I=1 TO TEKRAR
PORTB=1
SOLA
PAUSE 250
PORTB=PORTB<<1
IF PORTB.7=1 THEN GOTO SAGA
GOTO SOLA
SAGA
PAUSE 250
PORTB=PORTB>>1
IF PORTB.0=1 THEN GOTO BITTIMI
GOTO SAGA
BITTIMI:
PORTC=I
NEXT I
TEKRAR=0
PORTC=I
PAUSE 500
GOTO KONTROL
END
Soru 6:
TRISB=0
TRISA=1
ADCON1=7
PORTB=0
KONTROL:
IF PORTA=0 THEN GOTO START
GOTO KONTROL
START:
PORTB=1
PAUSE 6500
PORTB=3
PAUSE 1000
PORTB=4
PAUSE 4500
PORTB=1
GOTO START
END
Download

Soru 1