Close

Blinking and interrupts and stuff

A project log for DC motor board with attiny13

finally soldered

davedarkodavedarko 11/27/2016 at 09:410 Comments

When I started with the pin setting I first confused the pin direction setting byte with the state setting byte :D So I thought of breaking my code in peaces to fix the problems and start with the basics.

I found a library for the Attiny13A written by MCUdude on github - link is in the link section - that gives me a head start to use the Arduino IDE for coding. Feels weird saying that. Here's code for an LED flasher (german: "Wechselblinker") - two leds alternating the blinks.

void setup() {
  // put your setup code here, to run once:
    DDRB = 0x03; //PORTB
}

void loop() {
  // put your main code here, to run repeatedly:
  PORTB = (1<<PB1) | (0<<PB0);
  delay( 1000);
  PORTB = (0<<PB1) | (1<<PB0);
  delay( 1000);
}

I'll post the other code later.

Discussions