home *** CD-ROM | disk | FTP | other *** search
- /* Programma per PIC 16c84 o 16f84
- ** LUCI SEQUENZIALI ALLA KIT
- */
-
- #include <pic1684.h>
- #include "libxpic.c"
- #define NLED 8 /* numero di LED */
-
- void main()
- {
- int n; /* variabile di ciclo */
- int val; /* valore del bit corrsipondente al LED acceso */
-
- inizializza();
- val=1;
- while(1)
- {
- for(n=(NLED-1);n;n--) /* sx */
- {
- aspetta(1);
- PORTB=val;
- val<<=1;
- }
- for(n=(NLED-1);n;n--) /* dx */
- {
- aspetta(1);
- PORTB=val;
- val>>=1;
- }
- }
- }
-
-