#include "C:\Documents and Settings\mecaz\Desktop\ou\main.h"
int i=0;
const int digit[16]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,
0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
set_tris_b (0x01);
set_tris_d (0x00);
output_b (0x00);
output_d (0x00);
while(true){
if(input(PIN_B0)){
for(i=0;i<=15;i++)
{
output_d(digit[15-i]);
delay_ms(100);
}
}
delay_ms(15);
}
}