Пн май 29, 2017 10:24:29
Пн май 29, 2017 11:33:04
Пн май 29, 2017 14:58:48
#include <avr/io.h>
#define Seg_0 0b0111111; //0
#define Seg_1 0b0000110; //1
#define Seg_2 0b1011011; //2
#define Seg_3 0b1001111; //3
#define Seg_8 0b1111111; //8
#define butt1 (1<<PB0)
#define butt2 (1<<PB1)
#define butt3 (1<<PB2)
#define butt4 (1<<PB3)
//*****************************************8
int main(void)
{
DDRD=0xFF;
while(1)
{
uint8_t captch_B=PINB;
uint8_t out_P=Seg_0;
if (!(captch_B & butt1)) out_P=Seg_1;
if (!(captch_B & butt2)) out_P=Seg_2;
if (!(captch_B & butt3)) out_P=Seg_3;
if (!(captch_B & butt4)) out_P=Seg_8;
PORTD=out_P;
}
}
Пн май 29, 2017 17:41:03
Пн май 29, 2017 17:42:28
Пн май 29, 2017 21:43:08