Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <xc.h>
- #include <pic12f617.h>
- #pragma config WRT=OFF //Disable write protection
- #pragma config FOSC=INTOSCIO //Use internal clock, with I/O on clock pins.
- #pragma config MCLRE=OFF //Use MCLRE as an input pin.
- #pragma config WDTE=OFF //Disable Watchdog Timer
- #pragma config IOSCFS=4MHZ //Run at 4MHz
- #pragma config CP=OFF //No code protection
- #pragma config PWRTE=OFF //Enable Power-Up-Timer
- #pragma config BOREN=OFF //Disable Brownout reset
- void main()
- {
- WPU = 0xFF;
- TRISIO = 0b11111110;
- while(1)
- {
- if(GPIObits.GP5 == 1)
- GPIO = 0x01;
- else
- GPIO = 0x00;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment