Skip to content

Instantly share code, notes, and snippets.

@JHeld07
Created September 10, 2015 19:25
Show Gist options
  • Save JHeld07/fdc3c006966a7373ae70 to your computer and use it in GitHub Desktop.
Save JHeld07/fdc3c006966a7373ae70 to your computer and use it in GitHub Desktop.
#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