Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <at89c51xd2.h>
- unsigned char zaehler = 0;
- void warteAufTimer(){
- while(TF0 == 0){
- }
- zaehler++;
- return;
- }
- main(){
- TMOD = 0x01;
- TR0 = 1;
- ET0 = 1;
- EA = 1;
- while(1){
- TH0 = 0x3C;
- TL0 = 0xAF;
- warteAufTimer();
- P2 = zaehler;
- }
- }
- //timer() interrupt 1{
- // unsigned int i;
- // i++;
- // if(i>10){
- // zaehler++;
- // i = 0;
- // }
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement