From a80fe0458961153b0880724d33d784aceeedeeb3 Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Fri, 17 Aug 2018 11:04:53 -0600 Subject: [PATCH] starting basketball hoop port to CP --- .../NeoPixel_Basketball_Hoop.ino | 67 +++++++++++++++++++ NeoPixel_Basketball_Hoop/README.md | 4 ++ 2 files changed, 71 insertions(+) create mode 100644 NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop.ino create mode 100644 NeoPixel_Basketball_Hoop/README.md diff --git a/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop.ino b/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop.ino new file mode 100644 index 000000000..30c9c050b --- /dev/null +++ b/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop.ino @@ -0,0 +1,67 @@ +#include + +#define PIN 1 + +Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); + +void setup() { + strip.begin(); + strip.show(); // Initialize all pixels to 'off' +} + +void loop() { + // Some example procedures showing how to display to the pixels: + colorWipe(strip.Color(255, 0, 0), 50); // Red + colorWipe(strip.Color(0, 255, 0), 50); // Green + colorWipe(strip.Color(0, 0, 255), 50); // Blue + rainbow(20); + rainbowCycle(20); +} + +// Fill the dots one after the other with a color +void colorWipe(uint32_t c, uint8_t wait) { + for(uint16_t i=0; i