Jump to content

Led ring code for cannon and strips for backpack louvers Arduino Uno


Recommended Posts

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h> 
#endif

Adafruit_NeoPixel strip(12, 6, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip1(12, 5, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2(8, 7, NEO_GRB + NEO_KHZ800);
void setup() {

#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  
  strip.begin();          
  strip.show(); 
  strip1.begin(); 
  strip1.show(); 
  strip2.begin();  
  strip2.show(); 
  strip.setBrightness(255); 
  strip1.setBrightness(255);
  strip2.setBrightness(255);
}
void loop() {
  
  for(int i=0; i<=12; i++) { 
    strip.setPixelColor(i, 0,0,255);
    strip1.setPixelColor(12-i, 0,0,255);
    strip.show();
    strip1.show();
    strip2.setPixelColor(i, 0,0,255);         
    strip2.show();               
    delay(200);
  }
 for(int i=12; i>=0; i--) { 
    strip.setPixelColor(i, 0,0,0);
    strip1.setPixelColor(12-i, 0,0,0);
    strip.show();
    strip1.show();
    strip2.setPixelColor(i, 0,0,0);         
    strip2.show();               
    delay(200);                   
 }   
 } 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...