dzhon789 D dzhon789 Регистрация 24 Авг 2013 Сообщения 96 Репутация -3 Спасибо 0 Монет 0 25 Апр 2016 #1 #define F_CPU 80000000UL #include #include #include char n,k, m; int main(void) { unsigned char SwitchState; unsigned char C, B; DDRD= 0b11100111; DDRC= 0b11111111; while(1){ SwitchState = PIND; SwitchState = SwitchState & 0b00011000; m=0; C= 0b00000000; B= 0b00000000; PORTC=C; if(SwitchState == 0b00011000) { while(1){ PORTC|= C; for(k=8;k>m; k--) { B= (0b00000001<<k-1); PORTC= C|B; _delay_ms(20); PORTC = 0b00000000; if (k-1==m) {C|= B;}; if ((PIND&0b00011000)==0x00) { while ((PIND&0b00011000)==0x00); continue; } } m++; } } } }
#define F_CPU 80000000UL #include #include #include char n,k, m; int main(void) { unsigned char SwitchState; unsigned char C, B; DDRD= 0b11100111; DDRC= 0b11111111; while(1){ SwitchState = PIND; SwitchState = SwitchState & 0b00011000; m=0; C= 0b00000000; B= 0b00000000; PORTC=C; if(SwitchState == 0b00011000) { while(1){ PORTC|= C; for(k=8;k>m; k--) { B= (0b00000001<<k-1); PORTC= C|B; _delay_ms(20); PORTC = 0b00000000; if (k-1==m) {C|= B;}; if ((PIND&0b00011000)==0x00) { while ((PIND&0b00011000)==0x00); continue; } } m++; } } } }
Саша21 С Саша21 Регистрация 19 Ноя 2013 Сообщения 86 Репутация 0 Спасибо 0 Монет 0 25 Апр 2016 #2 Лол, это что за язык программирования такой Позитивный голос 0