ATTINY13 Low Power Led Flasher
Connect led to pin PB0 of Attiny13 (Pin No.5) Code: //ATTINY13A #define F_CPU 1200000UL // MCU frequency in hertz #include <avr/io.h> #include <avr/wdt.h> #include <avr/sleep.h> #include <avr/power.h> #include <avr/interrupt.h> #include <util/delay.h> #define led 0 // PB0 int main( void ) // similar to void setup () { wdt_reset(); // first you need to reset the Wachdog // otherwise there may be a reboot pinMode(led, OUTPUT); while (1) { // perpetual loop, analog of void loop () digitalWrite(led, HIGH); _delay_ms(50); // On Time ...
Comments
Post a Comment