8 Mart 2021 Pazartesi

Grafik ekran kullanımı ccs compiler

 Grafik ekran kullanımı ccs compiler

#include<16f877a.h>

#use delay(clock=4m)

#include<HDM64GS12.c>

#include<graphics.c>


void main(void)

{

char A5[]="A5";

char A4[]="A4";

char A3[]="A3";

char A2[]="A2";

char A1[]="A1";

char A0[]="A0";

char IN[]="sifirzero";


glcd_init(on);

glcd_text57(33, 30,A5, 1,1);

glcd_text57(49, 30,A4, 1,1);

glcd_text57(65, 30,A3, 1,1);

glcd_text57(81, 30,A2, 1,1);

glcd_text57(97, 30,A1, 1,1);

glcd_text57(113,30,A0, 1,1);

glcd_text57(30,5,IN, 1,1);


while(true)

{

if(input_state(pin_a5)==0)

glcd_rect(32,40,46,60,1,1);


else

glcd_rect(32,40,46,60,1,0);

glcd_rect(32,40,46,60,0,1);


if(input_state(pin_a4)==0)

glcd_rect(48,40,62,60,1,1);


else

glcd_rect(48,40,62,60,1,0);

glcd_rect(48,40,62,60,0,1);



if(input_state(pin_a3)==0)

glcd_rect(64,40,78,60,1,1);


else

glcd_rect(64,40,78,60,1,0);

glcd_rect(64,40,78,60,0,1);



if(input_state(pin_a2)==0)

glcd_rect(80,40,94,60,1,1);


else

glcd_rect(80,40,94,60,1,0);

glcd_rect(80,40,94,60,0,1);



if(input_state(pin_a1)==0)

glcd_rect(96,40,110,60,1,1);


else

glcd_rect(96,40,110,60,1,0);

glcd_rect(96,40,110,60,0,1);


if(input_state(pin_a0)==0)

glcd_rect(112,40,126,60,1,1);


else

glcd_rect(112,40,126,60,1,0);

glcd_rect(112,40,126,60,0,1);


delay_ms(400);

}

}



Hiç yorum yok:

Yorum Gönder

Her yorum bilgidir. Araştırmaya devam...