You are on page 1of 1

Muzammil ahmed

LAB#10
Lab No 10
Task: write a program for switching 4 relays 1 second for each using port in Bascom
language and show status of relay in hyper terminal.
Code
$baud=9600
rate
$crystal 22118000
crystal
Do
P1.0=1
P1.1=0
condition
P1.2=0
P1.3=0
Print Relay No 1 is ON and Rest are OFF

setting baud
setting value of
do loop

Wait 1
P1.0=0
P1.1=1
condition
P1.2=0
P1.3=0
Print Relay No 2 is ON and Rest are OFF
Wait 1
P1.0=0
condition
P1.1=0
P1.2=1
P1.3=0
Print Relay No 3 is ON and Rest are OFF
Wait 1
P1.0=0
P1.1=0
condition
P1.2=0
P1.3=1
Print Relay No 4 is ON and Rest are OFF
Wait 1
Loop
the loop
END

Muzammil ahmed
1345159 (B)
Date : 11/17/2015

return back to

You might also like