일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- 2019 유럽여행
- Minolta CLE
- Mamiya 7
- Germany
- N80/4
- Contax G2
- Kodak T-Max 100
- ZeissIkon ZI
- Leica M7
- GRD2
- Kodak 400TX
- M-Rokkor 40/2
- SONY A7
- FujiFilm C200
- Nikon 28Ti
- 4870
- Kodak 5222
- kodak t-max 400
- cf80/2.8
- cf50/4 fle
- G28/2.8
- 2018 미국출장
- Hasselblad 500cm
- Minolta TC-1
- Kodak Ektar 100
- fujifilm velvia 50
- Rollei35s
- FujiFilm GFX50s
- cs50/2.5
- Kentmere 400
- 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
여기도 참조하자.