Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

New Articles From Microcontroller Tips

Back
Top