Created
September 10, 2015 19:24
-
-
Save JHeld07/bdb91d93737dd7ffc45e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enter file contents here#include <18f4520.h> | |
#use delay(clock=20000000) | |
#fuses HS, NOWDT, NOLVP | |
#include "../Library/18f4520ptr.h" | |
/* | |
main(){ | |
*TRISC=0x00; | |
while(1){ | |
*PORTC^=0x01; | |
delay_ms(100); | |
} | |
} | |
*/ | |
//#5B | |
/*main(){ | |
*TRISC=0x00; | |
*PORTC=0x00; | |
while(1){ | |
*portc^=0x10; | |
delay_ms(50); | |
} | |
} | |
*/ | |
//#6 | |
struct myPortb{ | |
int unused:1; | |
BOOLEAN led:1; | |
int notused:6; | |
}; | |
struct myPortb*TEST=0xF81; | |
main(){ | |
// int *TRISB=0XF93; | |
*ADCON1=0X0F; | |
*TRISB=0x00; | |
TEST->led=0; | |
while(1){ | |
TEST->led=TEST->led^1; | |
delay_ms(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment