NataliaaaaaaaaAbraham Contreras
Published

P-chan Pin

Yet another pin with ATTINY in shape of a cute anime character ^^

BeginnerWork in progress1 hour536

Things used in this project

Hardware components

Microchip ATTINY13
×1
Battery holder cr2032
×1
push button 60x60
×1
LED 0805
×1
Capacitor 0805 0.1uF
×1
slide switch smd
×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

pchan_pbaUmSC9xS.pdf

Code

WIP p-chan test

C/C++
Pending button and "low power"
/********************************************************* 
 This sketch demonstrates the use of a watchdog timer.
 The watchdog timer causes a processor reset to occur if
 it is allowed to time out. When the sketch is running
 inside the second while loop, the watch dog timer is
 consistently reset to prevent a timeout. When PB0 is 
 pulled high, it breaks out of the while loop and causes 
 the watch dog timer to reset the processor.
 ********************************************************/ 

#include <avr/io.h>
#include <util/delay.h>
#include <avr/wdt.h>

// Variable to store the counted value (uint16_t = unsigned int)
uint16_t counter = 0;

#define LED1 0
#define LED2 1
#define LED3 4
#define BUTTON 3


void setup ()
 {


 pinMode(BUTTON, INPUT_PULLUP);
 pinMode(LED1, OUTPUT);
 pinMode(LED2, OUTPUT);
 pinMode(LED3, OUTPUT);
;

 }  // end of setup

void loop()
{

  digitalWrite(LED1,HIGH);
  digitalWrite(LED2,LOW);
  digitalWrite(LED3,LOW);
  
  delay(200);
  
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,HIGH);
  digitalWrite(LED3,LOW);
  
  delay(200);

  digitalWrite(LED1,LOW);
  digitalWrite(LED2,LOW);
  digitalWrite(LED3,HIGH);
  
  delay(200);
  
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,HIGH);
  digitalWrite(LED3,LOW);
  delay(200);



}

Credits

Nataliaaaaaaaa
32 projects • 49 followers
i like cute electronic projects.
Contact
Abraham Contreras
22 projects • 26 followers
Applications engineer and model scale maker
Contact

Comments

Please log in or sign up to comment.