목록Arduino (2)
STUDY BLOG

가만히 있으면 RGB LED 모듈 OFF 틸트센서 기울이면 REB LED 모듈 모든 색상 ON const int pinTilt = 2; const int pinLED_R = 10; const int pinLED_G = 9; const int pinLED_B = 8; int val = 0; void setup() { // put your setup code here, to run once: pinMode(pinLED_R, OUTPUT); pinMode(pinLED_G, OUTPUT); pinMode(pinLED_B, OUTPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: val = analogRea..

온도센서가 상온에 있을 때 : RGB 모듈이 파란색 ON 온도센서를 손으로 잡았을 때 : RGB 모듈이 빨간색 ON const int pinLM35 = 1; const int pinLED_R = 10; const int pinLED_G = 9; const int pinLED_B = 8; int val = 0; void setup() { // put your setup code here, to run once: pinMode(pinLED_R, OUTPUT); pinMode(pinLED_G, OUTPUT); pinMode(pinLED_B, OUTPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: val..