Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <p18cxxx.h>
- //#include "init.c"
- //#include "init.h"
- //void startop()
- #define led1 PORTBbits.RB0
- #define led2 PORTBbits.RB1
- #define led3 PORTBbits.RB2
- //#define led4 PORTBbits.RB3
- //#define led5 PORTBbits.RB4
- //#define led6 PORTBbits.RB5
- //#define onemilli Delay1KTCYx(12) //DELAY 1 mil sek
- #define milli50 Delay10KTCYx(60) //Delay 50mil sek
- /*delay på 1 sek*/
- void sekunder() //delay på 1 sek
- {
- int i;
- for(i=0;i<20;i++)
- {
- milli50; // delay10tcy(60)
- }
- }
- void main()
- {
- TRISBbits.TRISB0 = 0;
- TRISBbits.TRISB1 = 0;
- TRISBbits.TRISB2 = 0;
- TRISBbits.TRISB3 = 0;
- TRISBbits.TRISB4 = 0;
- TRISBbits.TRISB5 = 0;
- /* Reset the LEDs */
- PORTBbits.RB0 = 1;
- PORTBbits.RB1 = 1;
- PORTBbits.RB2 = 1;
- PORTBbits.RB3 = 1;
- PORTBbits.RB4 = 1;
- PORTBbits.RB5 = 1;
- //startop(); // Init
- led1 = 0; // led 1 lyser
- sekunder(); //tæller 1 sek
- led2 = 0;
- sekunder();
- led3 = 0;
- do{
- } while(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement