You are on page 1of 1

Start

Initialize all input and output ports


or pins

ISR

Read Start Button


(P1.2)(C)

P1.2=1

Read Level Sensor-


Cylinder1 (P1.0)(a)

P1.0=0 LED1 ON Read Level Sensor- LED2 ON Alarm ON


(P2.2)(l) P1.1=0
Cylinder2(P1.1)(b) (P2.3)(m) (P2.4)(n)

DC Motor ON DC Motor ON
Stop
(P2.5)(o) (P2.5)(o)

Read Limit switch Read Limit switch


(P1.3)(f) (P1.3)(f)

P1.3=1 P1.3=1

DC Motor OFF DC Motor OFF


(P2.5)(o) (P2.5)(o)
Call Count_reject Call Count_reject

Read Shape Detect Read Shape Detect


Sensor (P1.6)(i) Sensor (P1.6)(i)

P1.6=1
P1.6=1

Open Output Valve(V2)


Open Output Valve(V1) (P2.1)(k)
(P2.0)(j)

Call 250 ms Delay


Call 250 ms Delay
Call Count_reject
Close Output Valve(V2)
Close Output Valve(V1) (P2.1)(k)
(P2.0)(j)

Read Level Sensor-


Bottle(Ultra Sonic) (P1.5)(h)

P1.5=0

Capping the
Bottle

Read IR Sensor
(P1.4)(g)

P1.4=0

Call Count_accepted

Stop

You might also like