5.3 Ülesanne: Nelja lambi lülitamine ühe nupuga
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 esimesel START nupu vajutusel Start nupu indikaatorlambi sisse, teisel vajutusel Reset nupu indikaatorlambi sisse, kolmandal vajutusel Q1 indikaatorlambi sisse, neljandal vajutusel Q2 indikaatorlambi sisse ja viiendal korral kõik indikaatorlambid välja.
Korraga tohib põleda vaid üks indikaatorlamp.
Lülitamine peab olema korratav. START nupu allhoidmisel ei tohi esineda vilkumist.
Soovitatav lugemismaterjal
Ülesande lahendamiseks tutvuda järgmiste peatükkidega.
5.3 Exercise: Switching four lights with one button
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 on the control panel START button light when pressing the START button first time. By second pressing the RESET button light is switched on, by third pressing the light Q1 is switched on, by fourth pressing the light Q2 is switched on, and by fifth pressing all lights are switched off.
At any-time, only one light can be on.
The switching must be repeatable. There should be no flashing of the lights when holding the START button.