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.

Programming error in PIC microcontroller

Status
Not open for further replies.

Nakul

New Member
Hello everyone,

I was trying to code the following program in mikrobasic Pro. But I am getting an error

"356" main function is not defined main function is not defined

Can anyone suggest me what actually problem is with my program mentioned below...??

void main()
{
ADCON1 =0XFF;
PORTE = 0XFF;
TRISE = 0X0F;
PORTB =0;
TRISB=0;
PORTC=0;
TRISC=0;
PORTD=0;
TRISD=0;

Usart_Init(9600);
LCD_Init(&PORTD);
LCD_Cmd(LCD_CLEAR);
LCD_Cmd(LCD_CURSOR_OFF);
Lcd_Out(1,1,"temperatre");

//main loop
do{
//---perform temp reading
0w_Reset(&PORTE,2);
0w_Write(&PORTE,2,0xCC);
0w_Write(&PORTE,2,0x44);
Delay_us(120);

0w_Reset(&PORTE,2);
0w_Write(&PORTE,2,0xCC);
0w_Write(&PORTE,2,0xBE);
Delay_us(400);

temp=0w_Read(&PORTE,2);
temp=(0w_read(&PORTE,2)<<8)+temp;
//---format and display reslt on lcd
Display_Temperature(temp);
Delay_ms(500);
}while(1);

end
}
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top