'BL-L515'에 해당되는 글 1건

  1. 2016.09.18 RGB LED (BL-L515) [D006]

RGB LED (BL-L515) [D006]



https://www.youtube.com/watch?v=A9x5JjcyAf4


*GitHubhttps://github.com/rdiot/rdiot-d006.git


* Specs

5.0mm Round Type, RGB Full Color LED Lamps

Diffused and Water clear lens are available.

Popular T-1 diameter package.

IC compatible /Low current capability.

RoHs Compliance


* Contents

- DataSheet : http://www.alldatasheet.com/datasheet-pdf/pdf/699972/BETLUX/BL-L515.html


- Connect

R ----- D11

GND ----- GND

G ----- D10

B ----- D9


- Key Code

int redPin = 11;

int greenPin = 10;

int bluePin = 9;

 

void setup()

{

 pinMode(redPin, OUTPUT);

 pinMode(greenPin, OUTPUT);

 pinMode(bluePin, OUTPUT); 

}

 

void loop()

{

  setColor(255, 0, 0); // red

  delay(1000);

  setColor(0, 255, 0); // green

  delay(1000);

  setColor(0, 0, 255); // blue

  delay(1000);

  setColor(255, 255, 0); // yellow

  delay(1000); 

  setColor(80, 0, 80); // purple

  delay(1000);

  setColor(0, 255, 255); // aqua

  delay(1000);

}

 

void setColor(int red, int green, int blue)

{

  analogWrite(redPin, red);

  analogWrite(greenPin, green);

  analogWrite(bluePin, blue); 

}

Posted by RDIoT
|