projekte:2019:berlinbadge_rev1

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

Nächste Überarbeitung
Vorherige Überarbeitung
projekte:2019:berlinbadge_rev1 [2019/12/30 22:31]
max angelegt
projekte:2019:berlinbadge_rev1 [2021/05/15 10:26] (aktuell)
max [Pictures]
Zeile 1: Zeile 1:
 +{{:projekte:bbfront.jpg?300|}}
 +
 ====== BerlinBadge rev1 ====== ====== BerlinBadge rev1 ======
 +
 +Contact: [[user:nopx|nopx]]
 +
 +Projectstatus: [[projekte:projektstatus|{{:projekte:done.png?50|}}]]
 +
 +===== Summary =====
  
 [[https://twitter.com/vspaceone/status/1209177753842585602|Twitterlink zu Video!]] [[https://twitter.com/vspaceone/status/1209177753842585602|Twitterlink zu Video!]]
  
-{{:projekte:bbfront.jpg?400|}} +===== Pictures =====
-{{:projekte:berlinbadgebacak.jpg?400|}}+
  
 +{{:projekte:berlinbadgebacak.jpg?300|}}
 +{{:projekte:2019:photo_2021-05-15_12-20-07.jpg?300|}}
 +{{:projekte:2019:photo_2021-05-15_12-20-08.jpg?300|}}
 ===== Hardware ===== ===== Hardware =====
  
Zeile 12: Zeile 22:
 ===== BOM ===== ===== BOM =====
 ^ Label ^ Qty ^ Value ^ Footprint ^ Description ^ ^ Label ^ Qty ^ Value ^ Footprint ^ Description ^
-| BT1 | 1 | | JST PH 2.00mm 2-Pins Horizontal | |+| BT1 | 1 | Connector | JST PH 2.00mm 2-Pins Horizontal | |
 | C1, C4, C7, C9, C10, C13, C14 | 7 | 100nF | 0805 C | | | C1, C4, C7, C9, C10, C13, C14 | 7 | 100nF | 0805 C | |
 | C2, C3, C5, C6, C8, C11 | 6 | 2.2uF | 0805 C | | | C2, C3, C5, C6, C8, C11 | 6 | 2.2uF | 0805 C | |
Zeile 18: Zeile 28:
 | D1, D2, D3, D4, D5, D6, D7, D8 | 8 | WS2812B | 5050 LED P3.2mm | | | D1, D2, D3, D4, D5, D6, D7, D8 | 8 | WS2812B | 5050 LED P3.2mm | |
 | D9 | 1 | ca. 3V 10mA LED (Yellow) | 0805 LED | | | D9 | 1 | ca. 3V 10mA LED (Yellow) | 0805 LED | |
-| J1 | 1 | | 2x3 Odd_Even Pinheader 2.54mm Vertical NOT MOUNTED | | +| J1 | 1 | Connector | 2x3 Odd_Even Pinheader 2.54mm Vertical NOT MOUNTED | | 
-| J2 | 1 | | USB A Stewart SS52100-001 Horizontal | |+| J2 | 1 | USB A | USB A Stewart SS52100-001 Horizontal | |
 | JP1 | 1 | - | nothing to mount | Solder to match the maximum voltage of the battery | | | JP1 | 1 | - | nothing to mount | Solder to match the maximum voltage of the battery | |
-| P1 | 1 | - | nothing to mount | AVR ISProgrammer, [[projekte:maxconnect|MaxConnect Link]] | +| P1 | 1 | - | nothing to mount | AVR ISProgrammer, [[projekte:2019:maxconnect|MaxConnect Link]] | 
 | R1, R3 | 2 | 10K | 0805 R | | | R1, R3 | 2 | 10K | 0805 R | |
 | R2 | 1 | 1K | 0805 R | series resistor for D9, match current! | | R2 | 1 | 1K | 0805 R | series resistor for D9, match current! |
-| R4, R5, R6, R7, R8, R9 | OR | 0805 R | just for layouting reasons | +| R4, R5, R6, R7, R8, R9 | 6 | 0R | 0805 R | just for layouting reasons | 
-| SW1 | 1 | | SPDT_PCM12 Example: [[https://www.amazon.de/gp/product/B07VF4MW5W/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1|Amazon Link]] |+| SW1 | 1 | Switch | SPDT_PCM12 Example: [[https://www.amazon.de/gp/product/B07VF4MW5W/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1|Amazon Link]] |
 | U1 | 1 | ATTiny85-20SU | SOIJ-8_5.3x5.3mm P1.27mm | [[https://www.reichelt.de/mcu-attiny-avr-risc-8-kb-20-mhz-so-8-attiny-85-20-su-p69300.html?&trstct=pos_3|Reichelt ATTINY85-20SU]] | | U1 | 1 | ATTiny85-20SU | SOIJ-8_5.3x5.3mm P1.27mm | [[https://www.reichelt.de/mcu-attiny-avr-risc-8-kb-20-mhz-so-8-attiny-85-20-su-p69300.html?&trstct=pos_3|Reichelt ATTINY85-20SU]] |
 | U2 | 1 | MAX1811 | SOIC-8_3.9x4.9mm P1.27 | | | U2 | 1 | MAX1811 | SOIC-8_3.9x4.9mm P1.27 | |
  
 +===== Software =====
 +This is the arduino code running on rev1. You need to install the neopixel lib and compile for Attiny85 with **internal 16MHz**!
 +<code C>
 +#include <Adafruit_NeoPixel.h>
 +#ifdef __AVR__
 + #include <avr/power.h> // Required for 16 MHz Adafruit Trinket
 +#endif
 +
 +
 +#define LED_PIN     PB1
 +#define LED_COUNT  8
 +#define BRIGHTNESS 255
 +
 +Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_RGB + NEO_KHZ800);
 +
 +#define PERCENT_SPAWN 6
 +
 +struct C{
 +  byte red;
 +  byte green;
 +  byte blue;
 +};
 +
 +#define NUM_COLORS 16
 +C colors[] = {
 +  {0,0,255},
 +  {0,255,0},
 +  {255,0,0},
 +  {0,255,0},
 +  {60,240,0},
 +  {255,255,255},
 +  {10,40,128},
 +  {70,140,10},
 +  {140,70,10},
 +  {12,96,190},
 +  {200,10,80},
 +  {200,80,10},
 +  {80,10,190},
 +  {0,0,255},
 +};
 +
 +C leds[LED_COUNT];
 +C ledsIst[LED_COUNT];
 +int state[LED_COUNT];
 +
 +void setup() {
 +#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
 +  clock_prescale_set(clock_div_1);
 +#endif
 +
 +  strip.begin();
 +  strip.show();
 +  strip.setBrightness(BRIGHTNESS);
 +
 +  for(int i=0; i<strip.numPixels(); i++) {
 +    leds[i].red = 0;
 +    leds[i].blue = 0;
 +    leds[i].green = 0;
 +  }
 +}
 +
 +void clearLED(int i){
 +  leds[i].red = 0;
 +  leds[i].blue = 0;
 +  leds[i].green = 0;
 +}
 +
 +bool isOut(int i){
 +  return leds[i].red == 0 && leds[i].blue == 0 && leds[i].green == 0;
 +}
 +
 +void setLED(int i, C c){
 +  leds[i].red = c.red;
 +  leds[i].blue = c.blue;
 +  leds[i].green = c.green;
 +  state[i] = 1;
 +}
 +
 +void dimLED(int i){
 +  if(state[i] == 0){
 +    ledsIst[i].red = 0;
 +    ledsIst[i].green = 0;
 +    ledsIst[i].blue = 0;
 +    return;
 +  }
 +
 +  if(state[i] == 4){
 +    ledsIst[i].red = int(leds[i].red);
 +    ledsIst[i].blue = int(leds[i].blue);
 +    ledsIst[i].green = int(leds[i].green);
 +  }else if(state[i] > 4){
 +    int f = ((state[i]-4)*2);
 +    ledsIst[i].red = int(leds[i].red / f);
 +    ledsIst[i].blue = int(leds[i].blue / f);
 +    ledsIst[i].green = int(leds[i].green / f);
 +  }else if(state[i] < 4){
 +    int f = ((4-state[i])*2);
 +    ledsIst[i].red = int(leds[i].red / f);
 +    ledsIst[i].blue = int(leds[i].blue / f);
 +    ledsIst[i].green = int(leds[i].green / f);
 +  }
 +
 +  state[i]++;
 +  if(state[i] == 15){
 +    state[i] = 0;
 +  }
 +}
 +
 +void loop() {
 +  for(int i=0; i<strip.numPixels(); i++) {
 +    if( random(0,100) < PERCENT_SPAWN && state[i]==0){
 +      C col = colors[random(0,NUM_COLORS)];
 +      setLED(i,col);
 +    }
 +    dimLED(i);
 +  }
 +
 +  for(int i=0; i<strip.numPixels(); i++) {
 +    C col = ledsIst[i];
 +    strip.setPixelColor(i, col.red, col.green, col.blue);
 +  }
  
 +  strip.show();
 +  delay(70);
 +}
 +</code>
  
  • projekte/2019/berlinbadge_rev1.1577745105.txt.gz
  • Zuletzt geändert: 2020/10/18 14:01
  • (Externe Bearbeitung)