가구점 의뢰
Websat 제작
INTOSCIO
#define _XTAL_FREQ 8000000
#define BIT8
#include <htc.h>
#include <xlcd.h>
#include "stdio.h"
__CONFIG(FOSC_INTRC_NOCLKOUT & WDTE_OFF & PWRTE_ON & MCLRE_OFF & CPD_OFF);
__CONFIG(BOREN_ON & WRT_OFF & LVP_OFF & CP_OFF);
char Counter_String[16];
long int Counter = 20000;
int i;
int main()
{
TRISA = 0;
ANSEL = 0;
PORTA = 0xFF;
while(1)
{
//lcd_clear();
//lcd_puts("www.electroSome.com");
ANSELH = 0x0;
OpenXLCD(02);
SetDDRamAddr(0x82);
putrsXLCD("COUNTER MODE:");
while(BusyXLCD());
SetDDRamAddr(0xC5);
while(BusyXLCD());
sprintf(Counter_String,"%03u",Counter);
putrsXLCD(Counter_String);
while(BusyXLCD());
while (1)
{
PORTA = 0xF;
for (i=0; i<120; i++)
__delay_ms(100);
PORTA = 0x0F0;
for (i=0; i<130; i++)
__delay_ms(100);
Counter++;
sprintf(Counter_String,"%03u",Counter);
SetDDRamAddr(0xC5);
while(BusyXLCD());
putrsXLCD(Counter_String);
while(BusyXLCD());
}
}
return 0;
}
void Loop_Lcd (signed int Delay_input)
{
while (Delay_input > 0)
{
Delay_input --;
}
}
'졸업작품 > Counter (7Segment, LCD)' 카테고리의 다른 글
LCD Counter(주차장) (kkt11? 자외선센서) (발광부)(수광부) 한세트 (0) | 2016.09.18 |
---|---|
Seven Segment 기반 Counter (0) | 2016.09.16 |