Library za upravljanje RGB LEDicom. Funkcija unutar objetkta RGBLed prima parametre koji određuju intenzitet pojedine boje u RGB (0.0 - 1.0).

Dependents:   SUSTAV_KONTROLE_PRISTUPA

Committer:
boki96
Date:
Sun Feb 02 10:11:43 2020 +0000
Revision:
0:8a23399d0af4
RGB LED management library. The function inside the RGBLed object receives parameters that determine the intensity of each color in RGB (0.0 - 1.0).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
boki96 0:8a23399d0af4 1 #include "rgb.h"
boki96 0:8a23399d0af4 2 #include "mbed.h"
boki96 0:8a23399d0af4 3
boki96 0:8a23399d0af4 4 RGBLed::RGBLed (PinName crvenaPin, PinName zelenaPin, PinName plavaPin)
boki96 0:8a23399d0af4 5 : _crvenaPin(crvenaPin), _zelenaPin(zelenaPin), _plavaPin(plavaPin)
boki96 0:8a23399d0af4 6 {
boki96 0:8a23399d0af4 7 // Postavljanje takta na 2000 Hz
boki96 0:8a23399d0af4 8 _crvenaPin.period(0.0005);
boki96 0:8a23399d0af4 9 }
boki96 0:8a23399d0af4 10
boki96 0:8a23399d0af4 11 void RGBLed::prikaz(float crvena,float zelena, float plava)
boki96 0:8a23399d0af4 12 {
boki96 0:8a23399d0af4 13 _crvenaPin = crvena;
boki96 0:8a23399d0af4 14 _zelenaPin = zelena;
boki96 0:8a23399d0af4 15 _plavaPin = plava;
boki96 0:8a23399d0af4 16 }