JAWABAN ORKOM 3

3 2 1

JAWABAN TUGAS ORKOM

Iklan

jawaban tugas mikroprokontroller

#SENSOR AIR P0.0 –P0.4 (1=ADA AIR , 0= TIDAK ADA AIR)

ALARM P1.0 (1=BUNYI, 0=MATI)

P0MPA AIR P1.1 (1=HIDUP, 0=MATI)

LAMPU LED

P1.3=LOW

P1.4=HAMPIR LOW

P1.5=SEDANG

P1.6=HAMPIR FULL

P1.7=FULL

$MOD51tugas pak arnes

MOV P0,#00H

MOV P1,#00H

CEK:

JB P0.0,HIDUP

SETB P0.0

SETB P1.1

SETB P1.0

SETB P1.3

CALL DELAY

JB P0.1,HIDUP1

SETB P0.1

SETB P1.1

CLR P1.0

SETB P1.4

CALL DELAY

JB P0.2,HIDUP2

SETB P0.2

SETB P1.1

CLR P1.0

SETB P1.5

CALL DELAY

JB P0.3,HIDUP3

SETB P0.3

SETB P1.1

CLR P1.0

SETB P1.6

CALL DELAY

JB P0.4,HIDUP4

SETB P0.4

CLR P1.1

CLR P1.0

SETB P1.7

CALL DELAY

JNB P0.7,CEK

AJMP STOP

HIDUP:

CALL DELAY

AJMP CEK

HIDUP1:

CALL DELAY

AJMP CEK

HIDUP2:

CALL DELAY

AJMP CEK

HIDUP3:

CALL DELAY

AJMP CEK

HIDUP4:

CALL DELAY

AJMP CEK

DELAY:

MOV R0,#20

DELAY1:

DJNZ R0,DELAY1

RET

STOP:

END