/* *****************************************************************************
; *
; Filename: *
; Date: *
; File Version: 001 *
; *
; Author: Jason Lopez *
; Company: AtomSoft *
; *
;***************************************************************************** */
#include <p18f2525.h>
#include <delays.h>
#include <string.h>
#pragma config WDT = OFF, LVP = OFF, OSC = INTIO67, XINST = OFF
/************************************
Prototypes
*************************************/
void main(void);
#define lowO LATCbits.LATC4
#define highO LATCbits.LATC5
#define Btn PORTBbits.RB0
/************************************
Main
*************************************/
void main(void){
char time = 1;
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
ADCON1 = 0x0F; //Digital Pins (we dont need ADC)
TRISA = TRISB = TRISC = 0x00; //All Outputs
LATA = LATB = LATC = 0x00; //All Low
TRISBbits.TRISB0 = 1;
while(1){
lowO = 1;
highO = 0;
Delay10TCYx(time);
lowO = 0;
highO = 1;
Delay10TCYx(time);
if(Btn){
time++;
while(Btn);
Delay1KTCYx(10);
if(time > 10) time = 1;
}
}
}