5.4 Ülesanne: Kahe nupuga ühe lambi lülitamine 2
Juhtpaneeli kirjeldus
Juhtpaneelil on 3 nuppu (S1 - Start, S2 - Stop, S4 - Reset), üks võtmega lüliti (S3 - Auto/Man) ja 4 indikaatorlampi (H1, H2, H3, H4).
Ülesande püstitus
Koostada programm, mis lülitab juhtpaneeli indikaatorlambi Q1 sisse, kui hoida START nuppu 3 sekundit all. START nupu vabastamisel lülitatakse indikaatorlamp Q1 välja. Kui START nuppu on vajutatud rohkem kui 5 korda, siis ei tohi indikaatorlamp Q1 sisse lülituda.
Pärast STOP nupu vajutamist peab indikaatorlamp Q1 jälle töötama nii nagu kirjeldatud eespool.
Lülitamine peab olema korratav.
Soovitatav lugemismaterjal
Ülesande lahendamiseks tutvuda järgmiste peatükkidega.
5.4 Exercise: Switching a light with two buttons 2
Description of the control panel
The control panel has three buttons (S1 – Start button, S2 – Stop button, S4 – Reset button), one key switch (S3 – Auto/Man (in normal state, it is on Auto)) and 4 indicator lights (lamps) (H1 – Start light, H2 – Reset light, H3 – Light Q1, H4 – Light Q2).
Description of the exercise
Write a program that switches the control panel light Q1 on when the START button is pressed for 3 seconds. The light Q1 is switched off when the START button has been released. The light Q1 is not switched on after fifth operation of the light Q1.
After pressing the STOP button, the light Q1 is working as described above.
The switching must be repeatable.