diff options
author | root <root@artemis.panaceas.org> | 2016-11-23 17:50:35 +0000 |
---|---|---|
committer | root <root@artemis.panaceas.org> | 2016-11-23 17:50:35 +0000 |
commit | ea33a46e3df260aec187a032171c6ffa9ab253aa (patch) | |
tree | b9704054e8df8f99e1b59118ef2b07872e7f9558 /main.c | |
download | piotrs_thing-ea33a46e3df260aec187a032171c6ffa9ab253aa.tar.gz piotrs_thing-ea33a46e3df260aec187a032171c6ffa9ab253aa.tar.bz2 piotrs_thing-ea33a46e3df260aec187a032171c6ffa9ab253aa.zip |
fish
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 72 |
1 files changed, 72 insertions, 0 deletions
@@ -0,0 +1,72 @@ +#undef TESTING + +#include "pic16f917.h" + +#define __16f917 + + +typedef unsigned int config; +config __at 0x2007 __CONFIG = _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _HS_OSC ; + +void +msleep (int n) +{ + int j; + while (n--) + { + for (j = 0; j < 255; ++j) + { + } + } +} +void +sleep (int n) +{ + while (n--) + { + msleep (255); + } +} + +void thing(__sfr *t,__sfr *d) +{ +int i; + +for (i=0;i<8;++i) { +int c=1<<i; +*t=255^c; +*d=0; + +sleep(1); +sleep(1); +sleep(1); + +*d=255; + +sleep(1); +sleep(1); +sleep(1); + +} + +*t=255; +} + +void +main (void) +{ + + //ANSEL = 0x00; + WPU = 0xff; + +for (;;) { + +thing(&TRISA,&PORTA); +thing(&TRISB,&PORTB); +thing(&TRISC,&PORTC); +thing(&TRISD,&PORTD); +thing(&TRISE,&PORTE); +} + + +} |