NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define F_CPU 1000000

uint8_t zmienna;
uint8_t licznik = 0x00;

ISR(INT0_vect)
{

licznik = 0;
PORTA= 0b11101111;
_delay_ms(2);

switch(PINA)
{
case 0b11101111:
PORTB= 0b00000000;
break;
case 0b11101110:
PORTB= 0b00000001;
licznik++;
break;
case 0b11101101:
PORTB= 0b00000101;
licznik++;
break;
case 0b11101011:
PORTB= 0b00001001;
licznik++;
break;
case 0b11100111:
PORTB= 0b00001101;
licznik++;
break;
default:
PORTB= 0b11111111;
break;
}


PORTA= 0b11011111;
_delay_ms(2);


switch(PINA)
{
case 0b11011111:
PORTB= 0b00000000;
break;
case 0b11011110:
PORTB= 0b00000010;
licznik++;
break;
case 0b11011101:
PORTB= 0b00000110;
licznik++;
break;
case 0b11011011:
PORTB= 0b00001010;
licznik++;
break;
case 0b11010111:
PORTB= 0b00001110;
licznik++;
break;
default:
PORTB= 0b11111111;
break;
}

PORTA= 0b10111111;
_delay_ms(2);


switch(PINA)
{
case 0b10111111:
PORTB= 0b00000000;
break;
case 0b10111110:
PORTB= 0b00000011;
licznik++;
break;
case 0b10111101:
PORTB= 0b00000111;
licznik++;
break;
case 0b10111011:
PORTB= 0b00001011;
licznik++;
break;
case 0b10110111:
PORTB= 0b00001111;
licznik++;
break;
default:
PORTB= 0b11111111;
break;
}

PORTA= 0b01111111;
_delay_ms(2);

switch(PINA)
{
case 0b01111111:
PORTB= 0b00000000;
break;
case 0b01111110:
PORTB= 0b00000100;
licznik++;
break;
case 0b01111101:
PORTB= 0b00001000;
licznik++;
break;
case 0b01111011:
PORTB= 0b00001100;
licznik++;
break;
case 0b01110111:
PORTB= 0b00010000;
licznik++;
break;
default:
PORTB= 0b11111111;
break;
}
if(licznik > 1)
{
PORTB= 0b11111111;
}
PORTA = 0b00001111;
}

int main(void)
{
DDRA= 0xF0;
DDRB= 0xFF;

zmienna = MCUCR;
zmienna &= !(1<<ISC00);
zmienna |= (1<<ISC01);
MCUCR = zmienna;
GICR |= (1<<INT0);
sei();

while(1)
{

}
}
     
 
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.