Hi,
i have code in mickro C ,but i want to work in MPLAP c18 compiler
can any one know how to convert from Mickro C to MPLAP C18??i attached my file
i have code in mickro C ,but i want to work in MPLAP c18 compiler
can any one know how to convert from Mickro C to MPLAP C18??i attached my file
Rich (BB code):
// Lcd pinout settings
sbit LCD_RS at RD4_bit;
sbit LCD_EN at RD5_bit;
sbit LCD_D7 at RD3_bit;
sbit LCD_D6 at RD2_bit;
sbit LCD_D5 at RD1_bit;
sbit LCD_D4 at RD0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISD4_bit;
sbit LCD_EN_Direction at TRISD5_bit;
sbit LCD_D7_Direction at TRISD3_bit;
sbit LCD_D6_Direction at TRISD2_bit;
sbit LCD_D5_Direction at TRISD1_bit;
sbit LCD_D4_Direction at TRISD0_bit;
char txt1[] = "ROOM TUMPEATURE";
int x=0;
float temp=0;
char txt[12];
void main() {
lcd_init (); ADC_init (); //analogue and digital converter
lcd_cmd(_lcd_cursor_off);
TRISA.b0=1;
PortA.b0=0;
TRISC.b1=0;
PortC.b1=0;
while (1) {
x=ADC_read (0); // 0 refers to the port number
temp=x*0.489;
floattostr (temp,txt);
lcd_out (1,1,txt1);
lcd_out (2,2,txt);
if (temp<24) { PortC.b0=0; }
else { PortC.b1=1;}
} }
Attachments
-
108.3 KB Views: 13