Please help me convert this language to CCS compiler

Status
Not open for further replies.

Angustong

New Member
#include «p18f452.h»
#include «delays.h»

#pragma config OSC = HS
#pragma config LVP = OFF
#pragma config WDT = OFF

void main(void){

unsigned int count=0;
unsigned int led_out=0xFE;

//PORTA Digital I/O
ADCON1 = 0b00000110;

//PORTA Used For Inputs
TRISA = 0xFF;

//PORTD Used For Outputs
TRISD = 0x00;
PORTD = 0xFF;

while(1){
for(count=0;count<7;count++){
led_out = (led_out<<1);
PORTD = led_out;
Delay10KTCYx(40);
while(PORTAbits.RA0 == 1);
}
for(count=0;count<7;count++){
led_out = (led_out<<1)|0x01;
PORTD = led_out;
Delay10KTCYx(40);
while(PORTAbits.RA0 == 1);
}
for(count=0;count<7;count++){
led_out = (led_out>>1);
PORTD = led_out;
Delay10KTCYx(40);
while(PORTAbits.RA0 == 1);
}
for(count=0;count<7;count++){
led_out = (led_out>>1)|0x80;
PORTD = led_out;
Delay10KTCYx(40);
while(PORTAbits.RA0 == 1);
}
}
}
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…