Kod za upravljanje rasvjetom
Dependents: Upravljanje_svijetlima
Light.cpp@0:3abf7056b060, 24 months ago (annotated)
- Committer:
- keepurhealth
- Date:
- Fri Aug 26 15:37:32 2022 +0000
- Revision:
- 0:3abf7056b060
Upravljanje svjetlima v2.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
keepurhealth | 0:3abf7056b060 | 1 | #include "Light.h" // Inicijalizacija Light biblioteke |
keepurhealth | 0:3abf7056b060 | 2 | #include "mbed.h" // Inicijalizacija mbed biblioteke |
keepurhealth | 0:3abf7056b060 | 3 | |
keepurhealth | 0:3abf7056b060 | 4 | Light :: Light(PinName pin) : _pin(pin) // Deklaracija klonstruktora "Light" |
keepurhealth | 0:3abf7056b060 | 5 | { |
keepurhealth | 0:3abf7056b060 | 6 | _pin = 0; |
keepurhealth | 0:3abf7056b060 | 7 | } |
keepurhealth | 0:3abf7056b060 | 8 | void Light::Flash_control(int n) // Deklaracija funkcije "Flash_control" |
keepurhealth | 0:3abf7056b060 | 9 | { |
keepurhealth | 0:3abf7056b060 | 10 | _pin = !_pin; |
keepurhealth | 0:3abf7056b060 | 11 | ThisThread::sleep_for(n); // Funkcija slična wait_ms |
keepurhealth | 0:3abf7056b060 | 12 | } |
keepurhealth | 0:3abf7056b060 | 13 | |
keepurhealth | 0:3abf7056b060 | 14 | void Light :: Flash_off () { // Deklaracija funkcije Flash_control |
keepurhealth | 0:3abf7056b060 | 15 | _pin = 0; |
keepurhealth | 0:3abf7056b060 | 16 | } |