4.1 Ülesanne: Ühe nupuga ühe lambi sisse lülitamine ajalise viitega
Juhtpaneeli kirjeldus
Juhtpaneelil on 3 nuppu (S1 - Start, S2 - Stop, S4 - Reset), üks võtmega lüliti (S3 - Auto/Man) ja 4 indikaatortuld (H1, H2, H3, H4).
Ülesande püstitus
Koostada programm, mis lülitaks juhtpaneeli indikaatorlambi Q2 sisse kui STOP nuppu on hoitud 5 sekundit all. STOP nupu vabastamisel lülitatakse indikaatorlamp Q2 välja.
Lülitamine peab olema korratav ja nupu all hoidmisel ei tohi esineda vilkumist lampi töös.
Soovitatav lugemismaterjal
Ülesande lahendamiseks tutvuda järgmiste peatükkidega.
4.1 Exercise: Using a button to switch on light with a delay
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 Q2 on when the STOP button is held down for 5 seconds. When the STOP button is released, the light Q2 is switched off.
The switching must be repeatable. There should be no flashing of the lights when holding a button.