Seven Segment display rakam ve harfleri gösterme ccs compiler
#include<16f628a.h>
#fuses xt,put,nowdt,noprotect,nomclr
#use delay(internal=4m)
#use delay(clock=4m)
#use standard_io(a)
#use standard_io(b)
int display[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
int i=0;
void main()
{
output_b(0b0000000);
output_b(display[0]);
while(true)
{
if(input(pin_a0))
{
delay_ms(20);
for(i=0; i<16; i++)
{
output_b(display[i]);
delay_ms(300);
if(i==15)
{
output_b(display[0]);
}
}
}
}
}
Hiç yorum yok:
Yorum Gönder
Her yorum bilgidir. Araştırmaya devam...