NataliaaaaaaaaAbraham Contreras
Published

Tac Nayn Pendant

Tac Nayn destroyer of the world is Nyan Cat nemesis, this pendant uses ATTINY13 to dim its evil red eyes.

BeginnerWork in progress1 hour642

Things used in this project

Hardware components

Microchip ATTINY13
×1
slide switch smd
×1
Red LED 0805
×2
battery holder cr2032
Need to trim a little to fit the footprint
×1
push button 60x60
Preferable low profile
×1
JLCPCB Customized PCB
JLCPCB Customized PCB
×1

Software apps and online services

Arduino IDE
Arduino IDE
Microchip Studio
Microchip Studio

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematics

Code

Tac nayn

C/C++
Just Arduino fade example
/*
  Fade

  This example shows how to fade an LED on pin 9 using the analogWrite()
  function.

  The analogWrite() function uses PWM, so if you want to change the pin you're
  using, be sure to use another PWM capable pin. On most Arduino, the PWM pins
  are identified with a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Fade
*/

int led0 =  0 ;           // the PWM pin the LED is attached to
int led1 =  1 ;           // the PWM pin the LED is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
  // declare pin 9 to be an output:
  pinMode(led0, OUTPUT);
  pinMode(led1, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // set the brightness of pin 9:
  analogWrite(led0, brightness);
  analogWrite(led1, brightness);
  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 30 milliseconds to see the dimming effect
  /*
 digitalWrite(led0,HIGH);
 digitalWrite(led1,HIGH);
 delay(100);
 digitalWrite(led0,LOW);
 digitalWrite(led1,LOW);
 delay(100);*/
  delay(30);
}

Credits

Nataliaaaaaaaa

Nataliaaaaaaaa

32 projects • 47 followers
i like cute electronic projects.
Abraham Contreras

Abraham Contreras

22 projects • 26 followers
Applications engineer and model scale maker

Comments