Page 142 - MDP2020-2
P. 142

|    인천전자마이스터고등학교  ·············································································································
            136


                    PORTC=0x00;
                    PORTD=0x00;
                    delay_ms(200);
            }


              나)아두이노  [Arduino  Uno]
            #include  <Adafruit_NeoPixel.h>
            #define  ADC_PIN        A0


            #define  LED_PIN        8
            #define  LED_COUNT  280


            Adafruit_NeoPixel  strip(LED_COUNT,  LED_PIN,  NEO_GRB  +  NEO_KHZ800);


            void  setup()  {
                strip.begin();                              //  INITIALIZE  NeoPixel  strip  object  (REQUIRED)
                strip.show();                                //  Turn  OFF  all  pixels  ASAP
                strip.setBrightness(250);        //  Set  BRIGHTNESS  to  about  1/5  (max  =  255)
                pinMode(ADC_PIN,  INPUT);
            }
            void  loop(){
                strip.fill(strip.Color(127,  127,  127));
                strip.show();
                delayMicroseconds(500);
                strip.clear();
                strip.show();
                delay(17);
            }


            ※  도트  프로그램
              (변수  안에  채울  값을  계산        하는  프로그램)
   137   138   139   140   141   142   143   144   145   146   147