Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snowflake #1384

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions projects/snowflake/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "Mohid"
slack_handle: "@m0.hid"
github_handle: "@M0HID"
tutorial: N/A
wokwi: "https://wokwi.com/projects/418889150108342273"
---

# Snowflake

This is my snowflake design for Hacky Holidays. It consists of a button, 48 WS2812B LEDs and a XIAO ESP32C3.

This should cost around $30 including PCB manufacture, shipping and parts. I will be soldering everything myself to save on PCBa costs.

The code can be viewed [here](https://wokwi.com/projects/418889150108342273) which shows a chasing LED effect

Here are some pictures:
![image](https://github.com/user-attachments/assets/ad405bdd-c9ca-421a-99f4-8ff4ff19b22f)
![image](https://github.com/user-attachments/assets/20daac57-dd1c-4790-9447-e19dfaaa545a)
Binary file added projects/snowflake/cart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions projects/snowflake/code.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#include <Adafruit_NeoPixel.h>

#define PIN 3
#define NUM_PIXELS 64
#define DELAY_TIME 100
#define TRAIL_LENGTH 10
#define BUTTON_PIN 2

Adafruit_NeoPixel strip(NUM_PIXELS, PIN, NEO_GRB + NEO_KHZ800);

int snakePos = 0;
int tailPos = -1;
bool direction = true;

unsigned long lastButtonPress = 0;
unsigned long debounceDelay = 200;

void setup() {
strip.begin();
strip.show();
pinMode(BUTTON_PIN, INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
strip.clear();
strip.setPixelColor(snakePos, strip.Color(66, 227, 245));

if (tailPos != -1) {
for (int i = 0; i < TRAIL_LENGTH; i++) {
int trailIndex = tailPos - i;
if (trailIndex >= 0 && trailIndex < NUM_PIXELS) {
int brightness = map(i, 0, TRAIL_LENGTH - 1, 255, 0);
strip.setPixelColor(trailIndex, strip.Color(66 * brightness / 255, 227 * brightness / 255, 245 * brightness / 255));
}
}
}

strip.show();

if (direction) {
tailPos = snakePos;
snakePos++;

if (snakePos >= NUM_PIXELS) {
snakePos = 0;
tailPos = -1;
}
} else {
tailPos = snakePos;
snakePos--;

if (snakePos < 0) {
snakePos = NUM_PIXELS - 1;
tailPos = -1;
}
}

if (digitalRead(BUTTON_PIN) == LOW && (millis() - lastButtonPress) > debounceDelay) {
direction = !direction;
lastButtonPress = millis();
Serial.println("Button Pressed");
}

delay(DELAY_TIME);
}

Binary file added projects/snowflake/gerber.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions projects/snowflake/production/bom.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Designator,Footprint,Quantity,Value,LCSC Part #
"D1, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19, D2, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29, D3, D30, D31, D32, D33, D34, D35, D36, D37, D38, D39, D4, D40, D41, D42, D43, D44, D45, D46, D47, D48, D5, D6, D7, D8, D9",LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm,48,WS2812B,
SW1,SW_PUSH_6mm,1,SW_Push,
U1,XIAO-ESP32S3-SMD,1,XIAO-ESP32-C3-SMD,
51 changes: 51 additions & 0 deletions projects/snowflake/production/designators.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
D1:1
D10:1
D11:1
D12:1
D13:1
D14:1
D15:1
D16:1
D17:1
D18:1
D19:1
D2:1
D20:1
D21:1
D22:1
D23:1
D24:1
D25:1
D26:1
D27:1
D28:1
D29:1
D3:1
D30:1
D31:1
D32:1
D33:1
D34:1
D35:1
D36:1
D37:1
D38:1
D39:1
D4:1
D40:1
D41:1
D42:1
D43:1
D44:1
D45:1
D46:1
D47:1
D48:1
D5:1
D6:1
D7:1
D8:1
D9:1
REF**:1
SW1:1
U1:1
281 changes: 281 additions & 0 deletions projects/snowflake/production/netlist.ipc

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions projects/snowflake/production/positions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Designator,Mid X,Mid Y,Rotation,Layer
D1,128.0,-171.5,225.0,top
D10,161.5,-136.0,270.0,top
D11,126.5,-101.5,270.0,top
D12,146.0,-101.5,90.0,top
D13,176.0,-123.5,225.0,top
D14,165.5,-101.5,270.0,top
D15,185.5,-101.5,270.0,top
D16,176.0,-79.5,315.0,top
D17,120.75,-87.25,315.0,top
D18,134.5,-73.5,135.0,top
D19,162.0,-67.0,270.0,top
D2,106.0,-149.5,180.0,top
D20,146.5,-61.5,315.0,top
D21,158.0,-50.0,315.0,top
D22,141.0,-46.0,0.0,top
D23,106.0,-81.5,0.0,top
D24,106.0,-62.0,180.0,top
D25,127.736952,-31.763052,315.0,top
D26,106.0,-42.5,0.0,top
D27,106.0,-28.5,0.0,top
D28,84.5,-32.0,45.0,top
D29,92.25,-87.25,45.0,top
D3,106.0,-141.0,180.0,top
D30,78.5,-73.5,225.0,top
D31,72.0,-46.0,0.0,top
D32,66.5,-61.5,45.0,top
D33,55.0,-50.0,45.0,top
D34,51.5,-67.0,90.0,top
D35,86.5,-101.5,90.0,top
D36,67.0,-101.5,270.0,top
D37,36.8,-80.2,45.0,top
D38,47.5,-101.5,90.0,top
D39,27.5,-101.5,90.0,top
D4,106.0,-121.5,180.0,top
D40,36.8,-122.8,135.0,top
D41,92.25,-115.75,135.0,top
D42,78.5,-129.5,315.0,top
D43,51.2,-136.0,90.0,top
D44,66.5,-141.5,135.0,top
D45,55.0,-153.0,135.0,top
D46,72.0,-156.8,180.0,top
D47,106.5,-101.5,180.0,top
D48,84.4,-171.0,315.0,top
D5,120.642135,-115.642136,225.0,top
D6,134.5,-129.5,45.0,top
D7,141.0,-156.5,180.0,top
D8,146.5,-141.5,225.0,top
D9,158.0,-153.0,225.0,top
SW1,106.0,-130.5,0.0,top
U1,105.978864,-167.884,180.0,top
Binary file added projects/snowflake/production/snowflake.zip
Binary file not shown.
Binary file added projects/snowflake/schematic.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions projects/snowflake/src/BOM.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Name,LCSC P#,qty
WS2812B,C114586,48
XIAO ESP32-C3,N/A,1
Loading
Loading