DIY GUY Chris
Published © Apache-2.0

ATtiny13 DIY Electronics Earrings

This project will certainly make her happier Here I share the full making steps as well as the needed documents for Electronics DIY earring

BeginnerFull instructions provided4 hours1,308
ATtiny13 DIY Electronics Earrings

Things used in this project

Hardware components

ATtiny10 microcontroller
Microchip ATtiny10 microcontroller
×1
SparkFun RGB LED Breakout - WS2812B
SparkFun RGB LED Breakout - WS2812B
×1
JLCPCB Customized PCB
JLCPCB Customized PCB
×1
Slide Switch, DPDT
Slide Switch, DPDT
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot Air Station, Industrial
Hot Air Station, Industrial
Hot Plate, Convection
Hot Plate, Convection
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Custom parts and enclosures

GERBER files

Schematics

Schematic

Code

Code

Arduino
/*
   ATtiny 13 WS2812B-LED Fire-Effect Garden Lamp
   Author: dustinbrun
           licensed under CC BY 4.0

   Version 03.2021


   Make sure to Set in the Board Settings:
        Processor-Speed to 9.6 Mhz
        Millis, Tone Support to "No Millis, No Tone"
   After that Press "Burn Bootloader" to make sure that these Settings are applied


   ----------------------------- !!!! Configuration can be done in the "config.h file !!!! -----------------------------------------

*/

#include "light_ws2812.c"
#include "light_ws2812.h"
#include "random_avr.h"
#include "random_avr.c"
#include "config.h"

struct pix
{
  uint8_t g;
  uint8_t r;
  uint8_t b;
};
pix pixel[PIXEL_NUM];
const int brightness=10;
const int TimeDelay=3;



void setup()
{

  random_init(0xabcd); // initialize 16 bit seed
}

void loop()
{
    for (int i=255; i>=0; i--)
    {
      for(int j = 0; j < PIXEL_NUM; j++)
      {
        pixel[j].r = 0/brightness;
        pixel[j].g = 255/brightness;
        pixel[j].b = i/brightness;
      }
      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
      delay(TimeDelay);
    }
    for (int i=0; i<256; i++)
    {
      for(int j = 0; j < PIXEL_NUM; j++)
      {
        pixel[j].r = i/brightness;
        pixel[j].g = 255/brightness;
        pixel[j].b = 0/brightness;
      }
      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
      delay(TimeDelay);
    }
    for (int i=255; i>=0; i--)
    {
      for(int j = 0; j < PIXEL_NUM; j++)
      {
        pixel[j].r = 255/brightness;
        pixel[j].g = i/brightness;
        pixel[j].b = 0/brightness;
      }
      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
      delay(TimeDelay);
    }
    for (int i=0; i<256; i++)
    {
      for(int j = 0; j < PIXEL_NUM; j++)
      {
        pixel[j].r = 255/brightness;
        pixel[j].g = 0/brightness;
        pixel[j].b = i/brightness; 
      }
      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
      delay(TimeDelay);
    }
    for (int i=255; i>=0; i--)
    {
      for(int j = 0; j < PIXEL_NUM; j++)
      {
        pixel[j].r = i/brightness;
        pixel[j].g = 0/brightness;
        pixel[j].b = 255/brightness;
      }
      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
      delay(TimeDelay);
    }
    for (int i=0; i<256; i++)
    {
      for(int j = 0; j < PIXEL_NUM; j++)
      {
        pixel[j].r = 0/brightness;
        pixel[j].g = i/brightness;
        pixel[j].b = 255/brightness; 
      }
      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
      delay(TimeDelay);
    }

    for (int j=0; j<PIXEL_NUM; j++)
  {
    pixel[j].r = 0;
    pixel[j].g = 0;
    pixel[j].b = 0;
  }
    ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
    delay(TimeDelay);
//  for (int k=0; k<10; k++)
//  {
//    int selectedPixel=random(0,7);
//    for (int i=0; i<256; i++)
//    {
//      pixel[selectedPixel].r = i/brightness;
//      pixel[selectedPixel].g = 0/brightness;
//      pixel[selectedPixel].b = i/brightness; 
//      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
//      delay(1);
//    }
//
//    for (int i=255; i>=0; i--)
//    {
//      pixel[selectedPixel].r = i/brightness;
//      pixel[selectedPixel].g = 0/brightness;
//      pixel[selectedPixel].b = i/brightness;
//      ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
//      delay(1);
//    }
//  }
for(int i=0; i<7; i++)
{
  for (int j=0; j<PIXEL_NUM; j++)
  {
    pixel[j].r = 255/brightness;
    pixel[j].g = 128/brightness;
    pixel[j].b = 128/brightness;
    ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
    delay(30);
  }
  for (int j=0; j<PIXEL_NUM; j++)
  {
    pixel[j].r = 0;
    pixel[j].g = 0;
    pixel[j].b = 0;
    ws2812_setleds((struct cRGB *)pixel, PIXEL_NUM);
    delay(30);
  }
}
}

Credits

DIY GUY Chris

DIY GUY Chris

48 projects • 332 followers
I'm having fun while making electronics projects, I am an electrical engineer in love with "Do It Yourself" tasks.

Comments