Skip to content

Instantly share code, notes, and snippets.

@wildan3105
Last active August 16, 2017 04:38
Show Gist options
  • Save wildan3105/e3edb736829ce79e218e500797f6fd1b to your computer and use it in GitHub Desktop.
Save wildan3105/e3edb736829ce79e218e500797f6fd1b to your computer and use it in GitHub Desktop.
/*
* File: newmain.c
* Author: Wildan S. Nahar
*
* Created on April 27, 2017, 7:01 PM
*/
#define FCY 16000000UL
#include <xc.h>
#include <libpic30.h>
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
int main(){
ADPCFG = 0xffff; // Setup A/D PORT CONFIGURATION REGISTER as digital
ADPCFGbits.PCFG0 = 1; // configures pin RD0 as digital
TRISDbits.TRISD0= 0; // configures pin RD0 as output
while(1){
LATDbits.LATD0 = 1; // led ON
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment