Arduino (10) 썸네일형 리스트형 superloop PWM superloopPWM.ino int melody_en = 0; int servo_en = 0; int autofan_en = 0; void setup() { serial_setup(); // BTserial_setup(); melody_setup(); servo_setup(); autofan_setup(); } void loop() { serial_loop(); // BTserial_loop(); if(melody_en == 1) melody_loop(); if(servo_en == 1) servo_loop(); if(autofan_en == 1) autofan_loop(); } pitch.h /************************************************* * Public C.. superloop ADC_BT serial superloop_ADC.ino int potentiometer_en = 0; int tmp36sensor_en = 0; int photosensor_en = 0; int distancesensor_en = 0; void setup() { // serial_setup(); BTserial_setup(); potentiometer_setup(); tmp36sensor_setup(); photosensor_setup(); distancesensor_setup(); } void loop() { // serial_loop(); BTserial_loop(); if(potentiometer_en == 1) potentiometer_loop(); if(tmp36sensor_en == 1) tmp36sensor_loo.. superloop ADC superloop ADC.ino int potentiometer_en = 0; int tmp36sensor_en = 0; int photosensor_en = 0; int distancesensor_en = 0; void setup() { serial_setup(); // BTserial_setup(); potentiometer_setup(); tmp36sensor_setup(); photosensor_setup(); distancesensor_setup(); } void loop() { serial_loop(); // BTserial_loop(); if(potentiometer_en == 1) potentiometer_loop(); if(tmp36sensor_en == 1) tmp36sensor_loo.. Interrupt를 이용한 btn_toggle //arduino_superloop int blink_en = 1; int fading_en = 1; int blinkRGB_en = 1; int fadingRGB_en = 1; void setup() { blink_setup(); fading_setup(); blinkRGB_setup(); fadingRGB_setup(); } void loop() { if(blink_en == 1) blink_loop(); if(fading_en == 1)fading_loop(); if(blinkRGB_en == 1) blinkRGB_loop(); if(fadingRGB_en == 1) fadingRGB_loop(); } //LEDblink int blink_ledState = LOW; long blink_previo.. BT input Superloop.ino int blink_en =1; int fading_en =1; int blinkRGB_en =1; int fadingRGB_en = 0; void setup() { blink_setup(); fading_setup(); blinkRGB_setup(); fadingRGB_setup(); // serial_setup(); BTserial_setup(); } void loop() { if(blink_en == 1) blink_loop(); if(fading_en == 1) fading_loop(); if(blinkRGB_en == 1) blinkRGB_loop(); if(fadingRGB_en == 1) fadingRGB_loop(); // serial_loop(); BTserial_.. LED control with SerialRead superloop.ino int blink_en =1; int fading_en =1; int blinkRGB_en =1; int fadingRGB_en = 0; void setup() { blink_setup(); fading_setup(); blinkRGB_setup(); fadingRGB_setup(); serial_setup(); } void loop() { if(blink_en == 1) blink_loop(); if(fading_en == 1) fading_loop(); if(blinkRGB_en == 1) blinkRGB_loop(); if(fadingRGB_en == 1) fadingRGB_loop(); serial_loop(); } blink.ino int blink_state=LOW; .. RGB_fading superloop.ino void setup() { blink_setup(); fading_setup(); //blinkRGB_setup(); fadingRGB_setup(); } void loop() { blink_loop(); fading_loop(); //blinkRGB_loop(); fadingRGB_loop(); } fadingRGB.ino int fadingRGB_pin[3]={12,7,8}; unsigned long fadingRGB_prevTime[3]={0}; unsigned long fadingRGB_interval[3]={30,60,120}; int fadingRGB_val[3]={0}; int fadingRGB_dir[3]={1,1,1}; void fadingRGB_setup(){ .. RGB_Blink superloop.ino void setup() { blink_setup(); fading_setup(); blinkRGB_setup(); //fadingRGB_setup(); } void loop() { blink_loop(); fading_loop(); blinkRGB_loop(); //fadingRGB_loop(); } blinkRGB.ino unsigned long rgb_prevTime[3]={0}; unsigned long rgb_interval[3]={1000,2000,3000}; int rgb_pin[3]={12,7,8}; int rgb_state[3]={LOW,LOW,LOW}; void blinkRGB_setup(){ for(int i=0;i 이전 1 2 다음