diff --git a/3D_Printed_Guardian_Sword/3D_Printed_Guardian_Sword.ino b/3D_Printed_Guardian_Sword/3D_Printed_Guardian_Sword.ino new file mode 100644 index 000000000..6b6ac09ea --- /dev/null +++ b/3D_Printed_Guardian_Sword/3D_Printed_Guardian_Sword.ino @@ -0,0 +1,55 @@ +#include +#ifdef __AVR__ + #include +#endif + +// Which pin on the Arduino is connected to the NeoPixels? +// On a Trinket or Gemma we suggest changing this to 1 +#define PIN 4 + +// Color Segments +#define APIXELS 14 // number of first orange pixels +#define BPIXELS 84 // number of blue pixels +#define CPIXELS 93 // second orange pixels + +// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. +// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest +// example for more information on possible values. +Adafruit_NeoPixel pixels = Adafruit_NeoPixel(93, PIN, NEO_GRB + NEO_KHZ800); + +int delayval = 10; // delay for half a second + +void setup() { + // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket +#if defined (__AVR_ATtiny85__) + if (F_CPU == 16000000) clock_prescale_set(clock_div_1); +#endif + // End of trinket special code + + pixels.begin(); // This initializes the NeoPixel library. +} + +void loop() { + + // For the first 14 pixels, make them orange, starting from pixel number 0. + for(int i=0;i