일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- FujiFilm GFX50s
- Nikon 28Ti
- Contax G2
- FujiFilm C200
- Kodak T-Max 100
- Leica M7
- cf50/4 fle
- ZeissIkon ZI
- GRD2
- 4870
- SONY A7
- Rollei35s
- Mamiya 7
- fujifilm velvia 50
- 2018 미국출장
- Germany
- Kodak 5222
- cf80/2.8
- Minolta TC-1
- Hasselblad 500cm
- N80/4
- Kentmere 400
- cs50/2.5
- Kodak Ektar 100
- Minolta CLE
- Kodak 400TX
- M-Rokkor 40/2
- kodak t-max 400
- G28/2.8
- 2019 유럽여행
- Today
- Total
J 창고
[Arduino] RGB LED TEST 본문
const int analogOutPinRed = 11;
const int analogOutPinGreen = 10;
const int analogOutPinBlue = 9;
void setup() {
Serial.begin(9600);
}
void loop() {
int outputValueRed = 255;
int outputValueGreen = 255;
int outputValueBlue = 255;
for(int i=255;i>0;i=i-1){
outputValueRed = i;
analogWrite(analogOutPinRed, outputValueRed);
analogWrite(analogOutPinGreen, outputValueGreen);
analogWrite(analogOutPinBlue, outputValueBlue);
Serial.print("RED : ");
Serial.println(outputValueRed);
}
for(int i=0;i<256;i++){
outputValueRed = i;
analogWrite(analogOutPinRed, outputValueRed);
analogWrite(analogOutPinGreen, outputValueGreen);
analogWrite(analogOutPinBlue, outputValueBlue);
Serial.print("RED : ");
Serial.println(outputValueRed);
}
/* ================================================= */
for(int j=255;j>0;j=j-1){
outputValueGreen = j;
analogWrite(analogOutPinRed, outputValueRed);
analogWrite(analogOutPinGreen, outputValueGreen);
analogWrite(analogOutPinBlue, outputValueBlue);
Serial.print("Green : ");
Serial.println(outputValueGreen);
}
for(int j=0;j<256;j++){
outputValueGreen = j;
analogWrite(analogOutPinRed, outputValueRed);
analogWrite(analogOutPinGreen, outputValueGreen);
analogWrite(analogOutPinBlue, outputValueBlue);
Serial.print("Green : ");
Serial.println(outputValueGreen);
}
/* =========================================== */
for(int k=255;k>0;k=k-1){
outputValueBlue = k;
analogWrite(analogOutPinRed, outputValueRed);
analogWrite(analogOutPinGreen, outputValueGreen);
analogWrite(analogOutPinBlue, outputValueBlue);
Serial.print("Blue : ");
Serial.println(outputValueBlue);
}
for(int k=0;k<256;k++){
outputValueBlue = k;
analogWrite(analogOutPinRed, outputValueRed);
analogWrite(analogOutPinGreen, outputValueGreen);
analogWrite(analogOutPinBlue, outputValueBlue);
Serial.print("Blue : ");
Serial.println(outputValueBlue);
}
}
http://wiki.vctec.co.kr/opensource/arduino/rgbled
여기도 참조하자.