Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- void fv1(void);
- int main()
- {
- DDRG=0;
- unsigned char gomb;
- while(1)
- {
- gomb=PING;
- switch(gomb)
- {
- case 1: fv1();break;
- }
- }
- return 0;
- }
- void fv1(void)
- {
- int szam=31438,db=0;
- while (szam>0)
- {
- if((szam&0b1)==0b1)
- {
- db++;
- }
- szam=szam>>1;
- }
- DDRB=0xF0;
- DDRD=0xF0;
- PORTD=(db/10%10)<<4;
- PORTB=(db/1%10)<<4;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement