1. SENSOR >< 7SEGMENT 0-9 (ABC)
MULAI:
MOV P1,#0C0H ;tampil angka 0
JB SENSOR,$
ACALL DELAY
MOV P1,#0F9H ;tampil angka 1
JB SENSOR,$
ACALL DELAY
MOV P1,#0A4H ;tampil angka 2
JNB SENSOR,$
ACALL DELAY
MOV P1,#0B0H ;tampil angka 3
JB SENSOR,$
ACALL DELAY
MOV P1,#99H ;tampil angka 4
JB SENSOR,$
ACALL DELAY
MOV P1,#92H ;tampil angka 5
JB SENSOR,$
ACALL DELAY
MOV P1,#82H ;tampil angka 6
JB SENSOR,$
ACALL DELAY
MOV P1,#0F8H ;tampil angka 7
JB SENSOR,$
ACALL DELAY
MOV P1,#80H ;tampil angka 8
JB SENSOR,$
ACALL DELAY
MOV P1,#90H ;tampil angka 9
JB SENSOR,$
ACALL DELAY
SJMP MULAI
2. SENSOR >< LED
MULAI:
CLR LED1
CLR LED2
CLR LED3
JB TOMBOL1,$
SETB LED1
MOV P1,#0F9H
ACALL DELAY
CLR LED1
SETB LED2
JB TOMBOL2,$
MOV P1,#0A4H
ACALL DELAY
CLR LED2
SETB LED3
ACALL DELAY
SJMP MULAI
Langganan:
Postingan (Atom)