내용
메일로 받은 파일에 있는 RGB LED 모듈 테스트 코딩을 아래와 같이 코딩하여 넣었는데 파랑,초록불은 들어오지만 빨간 불이 들어오지 않습니다.
코딩에 이상이 있는건지 RGB LED 모듈의 문제인건지 잘 모르겠습니다.
//LED등 테스트
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);
delay(1000);
setColor(0,255,0);
delay(1000);
setColor(0,0,255);
delay(1000);
}
void setColor(int red, int green, int blue)
{
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}
첨부파일
2019_09_27 16:01
댓글목록
등록된 댓글이 없습니다.