Alan G. Smith wrote: > > I hope someone can help me. > I had the 770 version of HI-TECH C and I tried to apply the patches on the > website. > Unfortunately, I had changed one of the samples and now the patch won't apply. > My CD-ROM has STOPPED working and I have loaned someone my notebook computer. > Can someone PLEASE either send me the ORIGINAL LED.C from the CD-ROM OR the 3.20 > version > of the PATCH program. (The 771 patch should install it for you.) > > Thanks, > > Alan G. Smith > > P.S. I wouldn't bother everyone but evidently I am in an unstable state as my > program that used to > work fine doesn't > work at all with the recompile. (but the old .HEX file still works.) > > +--------------------------------------------------------- > | Alan G. Smith > | ags@poboxes.com > | http://www.innovatus.com/ags #include /* * Demo program - flashes LEDs on * Port B, responds to switch press * on RA1. Usable on PICDEM board. */ #define PORTBIT(adr, bit) ((unsigned)(&adr)*8+(bit)) static bit button @ PORTBIT(PORTA, 1); main(void) { unsigned i; unsigned char j; TRISB = 0; /* all bits output */ j = 0; for(;;) { PORTB = 0x00; /* turn all on */ for(i = 16000 ; --i ;) continue; PORTB = ~j; /* output value of j */ for(i = 16000 ; --i ;) continue; if(button == 0) /* if switch pressed, increment */ j++; } }