Skip to content

Commit d08cd17

Browse files
committed
re-add deleted files
1 parent 2226008 commit d08cd17

8 files changed

+682
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
import time
2+
import board
3+
import neopixel
4+
5+
pixel_count = 6 # Number of NeoPixels
6+
pixel_pin = board.D1 # Pin where NeoPixels are connected
7+
8+
speed = .1 # Animation speed (in seconds).
9+
# This is how long to spend in a single animation frame.
10+
# Higher values are slower.
11+
# Good values to try are 400, 200, 100, 50, 25, etc.
12+
13+
animation = 0 # Type of animation, can be one of these values:
14+
# 0 - Solid color pulse
15+
# 1 - Moving color pulse
16+
17+
color_steps = 8 # Number of steps in the animation.
18+
19+
brightness = 1.0 # 0-1, higher number is brighter
20+
21+
22+
# Adjacent colors (on color wheel).
23+
# red yellow
24+
color_animation = ([255, 0, 0], [255, 36, 0], [255, 72, 0], [255, 109, 0],
25+
[255, 145, 0], [255, 182, 0], [255, 218, 0], [255, 255, 0])
26+
27+
# Adjacent colors
28+
#([255, 0, 0], [255, 36, 0], [255, 72, 0], [255, 109, 0],
29+
# [255, 145, 0], [255, 182, 0], [255, 218, 0], [255, 255, 0]) # red yellow
30+
#([255, 255, 0], [218, 255, 0], [182, 255, 0], [145, 255, 0],
31+
# [109, 255, 0], [72, 255, 0], [36, 255, 0], [0, 255, 0]) # yello green
32+
#([0, 255, 0], [0, 255, 36], [0, 255, 72], [0, 255, 109],
33+
# [0, 255, 145], [0, 255, 182], [0, 255, 218], [0, 255, 255]) # green cyan
34+
#([0, 255, 255], [0, 218, 255], [0, 182, 255], [0, 145, 255],
35+
# [0, 109, 255], [0, 72, 255], [0, 36, 255], [0, 0, 255]) # cyan blue
36+
#([0, 0, 255], [36, 0, 255], [72, 0, 255], [109, 0, 255],
37+
# [145, 0, 255], [182, 0, 255], [218, 0, 255], [255, 0, 255]) # blue magenta
38+
#([255, 0, 255], [255, 0, 218], [255, 0, 182], [255, 0, 145],
39+
# [255, 0, 109], [255, 0, 72], [255, 0, 36], [255, 0, 0]) # magenta red
40+
41+
# Complimentary colors
42+
#([255, 0, 0], [218, 36, 36], [182, 72, 72], [145, 109, 109],
43+
# [109, 145, 145], [72, 182, 182], [36, 218, 218], [0, 255, 255]) # red cyan
44+
#([255, 255, 0], [218, 218, 36], [182, 182, 72], [145, 145, 109],
45+
# [109, 109, 145], [72, 72, 182], [36, 36, 218], [0, 0, 255]) # yellow blue
46+
#([0, 255, 0], [36, 218, 36], [72, 182, 72], [109, 145, 109],
47+
# [145, 109, 145], [182, 72, 182], [218, 36, 218], [255, 0, 255]) # green magenta
48+
49+
# Other combos
50+
#([255, 0, 0], [218, 36, 0], [182, 72, 0], [145, 109, 0],
51+
# [109, 145, 0], [72, 182, 0], [36, 218, 0], [0, 255, 0]) # red green
52+
#([255, 255, 0], [218, 255, 36], [182, 255, 72], [145, 255, 109],
53+
# [109, 255, 145], [72, 255, 182], [36, 255, 218], [0, 255, 255]) # yellow cyan
54+
#([0, 255, 0], [0, 218, 36], [0, 182, 72], [0, 145, 109],
55+
# [0, 109, 145], [0, 72, 182], [0, 36, 218], [0, 0, 255]) # green blue
56+
#([0, 255, 255], [36, 218, 255], [72, 182, 255], [109, 145, 255],
57+
# [145, 109, 255], [182, 72, 255], [218, 36, 255], [255, 0, 255]) # cyan magenta
58+
#([0, 0, 255], [36, 0, 218], [72, 0, 182], [109, 0, 145],
59+
# [145, 0, 109], [182, 0, 72], [218, 0, 36], [255, 0, 0]) # blue red
60+
#([255, 0, 255], [255, 36, 218], [255, 72, 182], [255, 109, 145],
61+
# [255, 145, 109], [255, 182, 72], [255, 218, 36], [255, 255, 0]) # magenta yellow
62+
63+
# Solid colors fading to dark
64+
#([255, 0, 0], [223, 0, 0], [191, 0, 0], [159, 0, 0],
65+
# [127, 0, 0], [95, 0, 0], [63, 0, 0], [31, 0, 0]) # red
66+
#([255, 153, 0], [223, 133, 0], [191, 114, 0], [159, 95, 0],
67+
# [127, 76, 0], [95, 57, 0], [63, 38, 0], [31, 19, 0]) # orange
68+
#([255, 255, 0], [223, 223, 0], [191, 191, 0], [159, 159, 0],
69+
# [127, 127, 0], [95, 95, 0], [63, 63, 0], [31, 31, 0]) # yellow
70+
#([0, 255, 0], [0, 223, 0], [0, 191, 0], [0, 159, 0],
71+
# [0, 127, 0], [0, 95, 0], [0, 63, 0], [0, 31, 0]) # green
72+
#([0, 0, 255], [0, 0, 223], [0, 0, 191], [0, 0, 159],
73+
# [0, 0, 127], [0, 0, 95], [0, 0, 63], [0, 0, 31]) # blue
74+
#([75, 0, 130], [65, 0, 113], [56, 0, 97], [46, 0, 81],
75+
# [37, 0, 65], [28, 0, 48], [18, 0, 32], [9, 0, 16]) # indigo
76+
#([139, 0, 255], [121, 0, 223], [104, 0, 191], [86, 0, 159],
77+
# [69, 0, 127], [52, 0, 95], [34, 0, 63], [17, 0, 31]) # violet
78+
#([255, 255, 255], [223, 223, 223], [191, 191, 191], [159, 159, 159],
79+
# [127, 127, 127], [95, 95, 95], [63, 63, 63], [31, 31, 31]) # white
80+
#([255, 0, 0], [255, 153, 0], [255, 255, 0], [0, 255, 0],
81+
# [0, 0, 255], [75, 0, 130], [139, 0, 255], [255, 255, 255]) # rainbow colors
82+
83+
# Global state used by the sketch
84+
strip = neopixel.NeoPixel(pixel_pin, pixel_count, brightness=1, auto_write=False)
85+
86+
while True: # Loop forever...
87+
88+
# Main loop will update all the pixels based on the animation.
89+
for i in range(pixel_count):
90+
91+
# Animation 0, solid color pulse of all pixels.
92+
if animation == 0:
93+
current_step = (time.monotonic() / speed) % (color_steps * 2 - 2)
94+
if current_step >= color_steps:
95+
current_step = color_steps - (current_step - (color_steps - 2))
96+
97+
# Animation 1, moving color pulse. Use position to change brightness.
98+
elif animation == 1:
99+
current_step = (time.monotonic() / speed + i) % (color_steps * 2 - 2)
100+
if current_step >= color_steps:
101+
current_step = color_steps - (current_step - (color_steps - 2))
102+
103+
strip[i] = color_animation[int(current_step)]
104+
105+
# Show the updated pixels.
106+
strip.show()

Techno_Tiki_RGB_LED_Torch/Techno_Tiki_No_Remote_Control/.gemma.test.only

Whitespace-only changes.

Techno_Tiki_RGB_LED_Torch/Techno_Tiki_No_Remote_Control/.gemma_m0.test.only

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Techno-Tiki RGB LED Torch (without IR Remote Control)
2+
// Created by Tony DiCola
3+
//
4+
// See guide at: https://learn.adafruit.com/techno-tiki-rgb-led-torch/overview
5+
//
6+
// Released under a MIT license: http://opensource.org/licenses/MIT
7+
#include <Adafruit_NeoPixel.h>
8+
9+
// Sketch configuration:
10+
#define PIXEL_PIN 1 // Pin connected to the NeoPixel strip.
11+
12+
#define PIXEL_COUNT 6 // Number of NeoPixels.
13+
14+
#define PIXEL_TYPE NEO_GRB + NEO_KHZ800 // Type of NeoPixel. Keep this the default
15+
// if unsure. See the NeoPixel library examples
16+
// for more explanation and other possible values.
17+
18+
#define SPEED_MS 100 // Animation speed (in milliseconds). This is how
19+
// long to spend in a single animation frame. Higher
20+
// values are slower. Good values to try are 400, 200,
21+
// 100, 50, 25, etc.
22+
23+
#define ANIMATION 0 // Type of animation, can be one of these values:
24+
// 0 - Solid color pulse
25+
// 1 - Moving color pulse
26+
27+
28+
// Color animation values. Each value is a 24-bit RGB color value that will be displayed
29+
// at that current step in the animation. Make sure only ONE row is uncommented below!
30+
const int colorSteps = 8; // Number of steps in the animation.
31+
const uint32_t colorAnimation[colorSteps] PROGMEM =
32+
// Complimentary colors
33+
//{ 0xFF0000, 0xDA2424, 0xB64848, 0x916D6D, 0x6D9191, 0x48B6B6, 0x24DADA, 0x00FFFF }; // Red-cyan
34+
//{ 0xFFFF00, 0xDADA24, 0xB6B648, 0x91916D, 0x6D6D91, 0x4848B6, 0x2424DA, 0x0000FF }; // Yellow-blue
35+
//{ 0x00FF00, 0x24DA24, 0x48B648, 0x6D916D, 0x916D91, 0xB648B6, 0xDA24DA, 0xFF00FF }; // Green-magenta
36+
37+
// Adjacent colors (on color wheel).
38+
{ 0xFF0000, 0xFF2400, 0xFF4800, 0xFF6D00, 0xFF9100, 0xFFB600, 0xFFDA00, 0xFFFF00 }; // Red-yellow
39+
//{ 0xFFFF00, 0xDAFF00, 0xB6FF00, 0x91FF00, 0x6DFF00, 0x48FF00, 0x24FF00, 0x00FF00 }; // Yellow-green
40+
//{ 0x00FF00, 0x00FF24, 0x00FF48, 0x00FF6D, 0x00FF91, 0x00FFB6, 0x00FFDA, 0x00FFFF }; // Green-cyan
41+
//{ 0x00FFFF, 0x00DAFF, 0x00B6FF, 0x0091FF, 0x006DFF, 0x0048FF, 0x0024FF, 0x0000FF }; // Cyan-blue
42+
//{ 0x0000FF, 0x2400FF, 0x4800FF, 0x6D00FF, 0x9100FF, 0xB600FF, 0xDA00FF, 0xFF00FF }; // Blue-magenta
43+
//{ 0xFF00FF, 0xFF00DA, 0xFF00B6, 0xFF0091, 0xFF006D, 0xFF0048, 0xFF0024, 0xFF0000 }; // Magenta-red
44+
45+
// Other combos.
46+
//{ 0xFF0000, 0xDA2400, 0xB64800, 0x916D00, 0x6D9100, 0x48B600, 0x24DA00, 0x00FF00 }; // Red-green
47+
//{ 0xFFFF00, 0xDAFF24, 0xB6FF48, 0x91FF6D, 0x6DFF91, 0x48FFB6, 0x24FFDA, 0x00FFFF }; // Yellow-cyan
48+
//{ 0x00FF00, 0x00DA24, 0x00B648, 0x00916D, 0x006D91, 0x0048B6, 0x0024DA, 0x0000FF }; // Green-blue
49+
//{ 0x00FFFF, 0x24DAFF, 0x48B6FF, 0x6D91FF, 0x916DFF, 0xB648FF, 0xDA24FF, 0xFF00FF }; // Cyan-magenta
50+
//{ 0x0000FF, 0x2400DA, 0x4800B6, 0x6D0091, 0x91006D, 0xB60048, 0xDA0024, 0xFF0000 }; // Blue-red
51+
//{ 0xFF00FF, 0xFF24DA, 0xFF48B6, 0xFF6D91, 0xFF916D, 0xFFB648, 0xFFDA24, 0xFFFF00 }; // Magenta-yellow
52+
53+
// Solid colors fading to dark.
54+
//{ 0xFF0000, 0xDF0000, 0xBF0000, 0x9F0000, 0x7F0000, 0x5F0000, 0x3F0000, 0x1F0000 }; // Red
55+
//{ 0xFF9900, 0xDF8500, 0xBF7200, 0x9F5F00, 0x7F4C00, 0x5F3900, 0x3F2600, 0x1F1300 }; // Orange
56+
//{ 0xFFFF00, 0xDFDF00, 0xBFBF00, 0x9F9F00, 0x7F7F00, 0x5F5F00, 0x3F3F00, 0x1F1F00 }; // Yellow
57+
//{ 0x00FF00, 0x00DF00, 0x00BF00, 0x009F00, 0x007F00, 0x005F00, 0x003F00, 0x001F00 }; // Green
58+
//{ 0x0000FF, 0x0000DF, 0x0000BF, 0x00009F, 0x00007F, 0x00005F, 0x00003F, 0x00001F }; // Blue
59+
//{ 0x4B0082, 0x410071, 0x380061, 0x2E0051, 0x250041, 0x1C0030, 0x120020, 0x090010 }; // Indigo
60+
//{ 0x8B00FF, 0x7900DF, 0x6800BF, 0x56009F, 0x45007F, 0x34005F, 0x22003F, 0x11001F }; // Violet
61+
//{ 0xFFFFFF, 0xDFDFDF, 0xBFBFBF, 0x9F9F9F, 0x7F7F7F, 0x5F5F5F, 0x3F3F3F, 0x1F1F1F }; // White
62+
63+
// Rainbow colors.
64+
//{ 0xFF0000, 0xFF9900, 0xFFFF00, 0x00FF00, 0x0000FF, 0x4B0082, 0x8B00FF, 0xFFFFFF };
65+
66+
67+
// Global state used by the sketch:
68+
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
69+
70+
void setup(void) {
71+
// Initialize and clear the NeoPixel strip.
72+
strip.begin();
73+
strip.clear();
74+
strip.show(); // Initialize all pixels to 'off'
75+
}
76+
77+
void loop(void) {
78+
// Main loop will update all the pixels based on the animation.
79+
for (int i = 0; i < PIXEL_COUNT; ++i) {
80+
switch (ANIMATION) {
81+
case 0:
82+
{
83+
// Animation 0, solid color pulse of all pixels.
84+
uint8_t currentStep = (millis()/SPEED_MS)%(colorSteps*2-2);
85+
if (currentStep >= colorSteps) {
86+
currentStep = colorSteps-(currentStep-(colorSteps-2));
87+
}
88+
// Note that colors are stored in flash memory so they need to be read
89+
// using the pgmspace.h functions.
90+
uint32_t color = pgm_read_dword_near(&colorAnimation[currentStep]);
91+
strip.setPixelColor(i, color);
92+
break;
93+
}
94+
case 1:
95+
{
96+
// Animation 1, moving color pulse. Use position to change brightness.
97+
uint8_t currentStep = (millis()/SPEED_MS+i)%(colorSteps*2-2);
98+
if (currentStep >= colorSteps) {
99+
currentStep = colorSteps-(currentStep-(colorSteps-2));
100+
}
101+
// Note that colors are stored in flash memory so they need to be read
102+
// using the pgmspace.h functions.
103+
uint32_t color = pgm_read_dword_near(&colorAnimation[currentStep]);
104+
strip.setPixelColor(i, color);
105+
break;
106+
}
107+
}
108+
}
109+
// Show the updated pixels.
110+
strip.show();
111+
}

0 commit comments

Comments
 (0)