??? 01/20/09 07:49 Read: times |
#161626 - Reply to no code Responding to: ???'s previous message |
Hi,
I'll try again. Actually I'll paste it here as well, to be sure , to be sure. #include <DS89C4xx.h> #include "lcd.h" #include "init8051.h" sbit LED0 = P3^0; sbit LED1 = P3^1; sbit LED2 = P3^2; sbit LED3 = P3^3; sbit LED4 = P3^4; sbit LED5 = P3^5; sbit LED6 = P3^6; sbit LED7 = P3^7; volatile unsigned long count = 1000; volatile unsigned char flash = 0; intrptcnt = 0; void Timer0_ISR (void) interrupt 1 { ET0 = 0; TF0 = 0; //clear flag intrptcnt++; TL0 = 0xCC; TH0 = 0xD4; ET0 = 1; } void main (void) { P0 = 0xFF; //turn off leds initController(); delayMs(1000); LcdInit(); while(1) { if (intrptcnt == count) { LED0 = ~LED0; intrptcnt = 0; flash++; if (flash == 100) flash = 0; } /* if (flash % 4 == 0) { LcdWriteString(" Hello World"); } else { LcdClear();//clear } */ } } #include <DS89C4xx.h> #include "lcd.h" #include "init8051.h" sbit LED0 = P3^0; sbit LED1 = P3^1; sbit LED2 = P3^2; sbit LED3 = P3^3; sbit LED4 = P3^4; sbit LED5 = P3^5; sbit LED6 = P3^6; sbit LED7 = P3^7; volatile unsigned long count = 1000; volatile unsigned char flash = 0; intrptcnt = 0; void Timer0_ISR (void) interrupt 1 { ET0 = 0; TF0 = 0; //clear flag intrptcnt++; TL0 = 0xCC; TH0 = 0xD4; ET0 = 1; } void main (void) { P0 = 0xFF; //turn off leds initController(); delayMs(1000); LcdInit(); while(1) { if (intrptcnt == count) { LED0 = ~LED0; intrptcnt = 0; flash++; if (flash == 100) flash = 0; } /* if (flash % 4 == 0) { LcdWriteString(" Hello World"); } else { LcdClear();//clear } */ } } |
Topic | Author | Date |
Program Conflict | 01/01/70 00:00 | |
More info | 01/01/70 00:00 | |
Reply to Per Westermark | 01/01/70 00:00 | |
no code | 01/01/70 00:00 | |
Reply to no code | 01/01/70 00:00 | |
Too slow sampling | 01/01/70 00:00 | |
Reply to Too Slow sampling | 01/01/70 00:00 | |
Catch that magic marker | 01/01/70 00:00 | |
Replay to Catch that magic marker | 01/01/70 00:00 | |
Edison | 01/01/70 00:00 | |
Try this...![]() | 01/01/70 00:00 |