自行车风火轮 arduino

简介:自行车夜间骑行不好看怎么办,淘宝又贵,倒不如自己做一个发光的好东西!

开源协议: CC-BY-NC-SA 3.0

发布时间:2020-08-13 20:06:03
  • 1.5k
  • 2
  • 12
描述

采用arduino主控,这是第一代产品,后续会改进一下。IMG_20200821_210153.jpgIMG_20200820_111956.jpgIMG_20200822_084103.jpg



这个是配套的arduino程序

#include <FastLED.h>
#define LED_PIN     3
#define NUM_LEDS    14
CRGB leds[NUM_LEDS];
void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
    leds[0] = CRGB ( 111, 111, 111);
  FastLED.show();
  delay(1000);
    leds[2] = CRGB ( 111, 111, 111);
  FastLED.show();
  delay(1000);
     leds[4] = CRGB ( 111, 111, 111);
  FastLED.show();
  delay(1000);
      leds[6] = CRGB ( 111, 111, 111);
  FastLED.show();
  delay(1000);
    leds[8] = CRGB ( 111, 111, 111);
  FastLED.show();
  delay(1000);
     leds[10] = CRGB ( 111, 111, 111);
  FastLED.show();
  delay(1000);
}

void loop() {

for(int a = 0; a <= 13; a++)
{
    for (int i = 0; i <= 13; i++) {
        leds[i] = CRGB ( 0, 0, 0);
        FastLED.show();
      }
  leds[a] = CRGB ( 0, 0, 255);
   FastLED.show();
   delay(100);
}

for(int a = 0; a <= 13; a++)
{
    for (int i = 0; i <= 13; i++) {
        leds[i] = CRGB ( 0, 0, 0);
        FastLED.show();
      }
  leds[a] = CRGB ( 0, 255, 0);
   FastLED.show();
   delay(100);
}

for(int a = 0; a <= 13; a++)
{
    for (int i = 0; i <= 13; i++) {
        leds[i] = CRGB ( 0, 0, 0);
        FastLED.show();
      }
  leds[a] = CRGB ( 255, 0, 0);
   FastLED.show();
   delay(100);
}

  for (int i = 0; i <= 13; i++) {
    leds[i] = CRGB ( 255, 0, 0);
    FastLED.show();
    delay(110);
  }
  for (int i = 0; i <= 13; i++) {
    leds[i] = CRGB ( 0, 255, 0);
    FastLED.show();
    delay(110);
  }
    for (int i = 0; i <= 13; i++) {
    leds[i] = CRGB ( 0, 0, 255);
    FastLED.show();
    delay(110);
  }

for(int b = 170; b < 255; b++)
{
     for (int i = 0; i <= 13; i++) 
     {
      leds[i] = CRGB ( b, b, 0);
      FastLED.show();
      delay(10);
    }

     for (int i = 0; i <= 13; i++) 
     {
      leds[i] = CRGB ( b, 0, b);
      FastLED.show();
      delay(10);
    }

    for (int i = 0; i <= 13; i++) 
     {
      leds[i] = CRGB ( 0, b, b);
      FastLED.show();
      delay(10);
    }
}

  for (int k = 0; k <= 5; k++)
  {

  for (int i = 0; i <= 13; i++) {
    leds[i] = CRGB ( 255, 0, 0);
    FastLED.show();
    delay(30);
  }
  for (int i = 0; i <= 13; i++) {
    leds[i] = CRGB ( 0, 255, 0);
    FastLED.show();
    delay(30);
  }
    for (int i = 0; i <= 13; i++) {
    leds[i] = CRGB ( 0, 0, 255);
    FastLED.show();
    delay(30);
  }

  }
}
设计图

PCB_2020-08-14_08-09-17

在编辑器中打开
ID Name Designator Footprint Quantity
1 CH340C_JX U9 SOP16_150MIL_JX 1
2 1TS001G-1700-1700 SW1 SW-SMD_4P-L5.1-W5.1-P3.70-LS6.5 1
3 22k R7,R8 RES-ADJ-SMD_3P-L3.8-W3.6-P1.90-BL 2
4 MICRO5.9MMUSB USB1 MICRO-USB-SMD_5P-P0.65-H-F_MICRO5.9MMUSB 1
5 HDR-F-2.54_1x6 H4 HDR-F-2.54_1X6 1
6 88.7K R1 R0805 1
7 3.3uH L2 IND-SMD_L4.0-W4.0_SMNR4012 1
8 SM340AF D1 SMA-FL_L3.5-W2.5-LS4.6-L-RD 1
9 X322516MLB4SI X2 OSC-SMD_4P-L3.2-W2.5-BL 1
10 10K R9 0402 1
11 IRM-56384 IR1 OPTO-TH_IRM-56384 1
12 0.1u C19,C21 C0603 2
13 1m L4,L6,L7,L9,L10 L0805 5
14 1m L8 F0603 1
15 22uF C17,C20 C0805 2
16 SK-3296S-01-L1 SW2,SW3 SW-SMD_3P-P1.50_L2.7-W6.6 2
17 12K R2 R0805 1
18 FP6291LR-G1 U1 SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BR 1
19 HDR-F-2.54_1x3 H7,H1,H3,H2,H5 HDR-F-2.54_1X3 5
20 100nf C15 C0603 1
21 100nf C14 C0805 1
22 100nF C11,C10,C16 C0603 3
23 100nF C1,C2,C3,C4,C5,C34,C22,C6,C7,C8,C9,C18,C23,C24,C25,C26,C27,C28,C29,C32,C33 C0603 21
24 WS2812E LED1,LED2,LED3,LED4,LED5,LED6,LED13,LED7,LED8,LED9,LED10,LED11,LED12,LED14,LED15,LED16,LED17,LED18,LED19,LED20,LED21 LED-SMD_4P-L5.0-W5.0-TL 21
25 贴片开关 L1,L3 贴片开关 2
26 B2B-XH-A (LF)(SN) CN1 CONN-TH_B2B-XH-A (LF)(SN) 1
27 1k R24,R19 R0805 2
28 10k R3 R0805 1
29 22pF C13,C12 C0603 2
30 ATMEGA328P-AU U3 窄的ARDUINO 1
31 10uf C30 C0603 1
32 GMI6050P-64DB MIC2 MIC-TH_BD6.0-P1.90-D0.4-L-RD 1

展开

工程成员

服务时间

周一至周五 9:00~18:00
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 开源平台公众号

    oshwhub