NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <avr/io.h>
#include <avr/interrupt.h>

#define LED1_PIN (1<<PA0)
#define LED2_PIN (1<<PA1)
#define LED3_PIN (1<<PA2)
#define LED4_PIN (1<<PA3)
#define LED5_PIN (1<<PA4)
#define LED6_PIN (1<<PA5)
#define LED7_PIN (1<<PA6)
#define LED8_PIN (1<<PA7)
#define LED1_ON PORTA &= ~LED1_PIN //załączenie diody 1
#define LED1_OFF PORTA |= LED1_PIN //wyłączenie diody 1
#define LED2_ON PORTA &= ~LED2_PIN
#define LED2_OFF PORTA |= LED2_PIN
#define LED3_ON PORTA &= ~LED3_PIN
#define LED3_OFF PORTA |= LED3_PIN
#define LED4_ON PORTA &= ~LED4_PIN
#define LED4_OFF PORTA |= LED4_PIN
#define LED5_ON PORTA &= ~LED5_PIN
#define LED5_OFF PORTA |= LED5_PIN
#define LED6_ON PORTA &= ~LED6_PIN
#define LED6_OFF PORTA |= LED6_PIN
#define LED7_ON PORTA &= ~LED7_PIN
#define LED7_OFF PORTA |= LED7_PIN
#define LED7_ON PORTA &= ~LED7_PIN
#define LED7_OFF PORTA |= LED7_PIN
#define LED8_ON PORTA &= ~LED8_PIN
#define LED8_OFF PORTA |= LED8_PIN

//definicje zmiennych
//uint8_t x;


//int main(void)
//{
/* TCNT1 = 0;
DDRA |= ( LED1_PIN | LED2_PIN | LED3_PIN | LED4_PIN | LED5_PIN | LED6_PIN | LED7_PIN | LED8_PIN); //kierunek pinu - wyjściowy
//PORTA &= ~ LED1_PIN | LED2_PIN | LED3_PIN | LED4_PIN | LED5_PIN | LED6_PIN | LED7_PIN; // wyłączenie diód

TIMSK |= (1<<OCIE1A); //Przerwanie overflow (przepełnienie timera)
TCCR1B |= (1 << WGM12); //Tryb CTC
OCR1A = 15624;
TCCR1B |= (1<<CS10) | (1<<CS11); // źródłem CLK, preskaler 1024

x=0;
while(x<8) //wykona się pięć razy
{
// LED1_ON; //załączenie diody
LED1_OFF;

LED2_OFF; //załączenie diody

LED3_OFF; //załączenie diody

LED4_OFF; //załączenie diody

LED5_OFF; //załączenie diody

LED6_OFF; //załączenie diody

LED7_OFF; //załączenie diody

LED8_OFF; //załączenie diody

x=x+1;
}


}
*/

void timer1_init()
{
TCCR1B |= (1 << WGM12)|(1 << CS11)| (1 << CS10);
TCNT1 = 0;
OCR1A = 10000;
}

int main (void)
{

DDRA |= (1 << 0);

timer1_init();

while(1)
{

if (TIFR & (1 << OCF1A))
{

PORTA ^=(1 << 0);

}

TIFR |= (1 << OCF1A);

}
}



     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.