[help] explain code in mikroC

General discussion on mikroC.
Post Reply
Author
Message
Eng_Bandar
Posts: 65
Joined: 04 Jun 2010 01:13

[help] explain code in mikroC

#1 Post by Eng_Bandar » 04 Jun 2010 01:24

Hi all,
I'm new here. Can anyone explain this code for me ( please step by step )

Code: Select all

char *text = "mikroElektronika";

void main() {
  Lcd_Config(&PORTB, 4, 5, 6, 3, 2, 1, 0); // Lcd_Init_EP5, see Autocomplete

  LCD_Cmd(LCD_CLEAR);       // Clear display
  LCD_Cmd(LCD_CURSOR_OFF);  // Turn cursor off
  LCD_Out(1,1, text);       // Print text to LCD, 1st row, 1st column
  Delay_ms(1000);
  LCD_Out(2,6,"mikroE");    // Print text to LCD, 2nd row, 6th column
}
especially, first line and third line.

Thank Guys

Eng_Bandar
Posts: 65
Joined: 04 Jun 2010 01:13

Re: [help] explain code in mikroC

#2 Post by Eng_Bandar » 04 Jun 2010 19:40

Up
Up
Up
Up

CVMichael
Posts: 239
Joined: 30 Apr 2009 02:36
Location: Canada, Toronto

Re: [help] explain code in mikroC

#3 Post by CVMichael » 04 Jun 2010 20:48

I think you are not getting replies because the code you posted is too simple, and it is commented also.

You have comments in the code, and also, you could search for the commands in the MikroC help file to give you more info. Did you try searching to Lcd_Config in the help file ?

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: [help] explain code in mikroC

#4 Post by tihomir.losic » 07 Jun 2010 13:51

Eng_Bandar wrote:Hi all,
I'm new here. Can anyone explain this code for me ( please step by step )

Code: Select all

char *text = "mikroElektronika";

void main() {
  Lcd_Config(&PORTB, 4, 5, 6, 3, 2, 1, 0); // Lcd_Init_EP5, see Autocomplete

  LCD_Cmd(LCD_CLEAR);       // Clear display
  LCD_Cmd(LCD_CURSOR_OFF);  // Turn cursor off
  LCD_Out(1,1, text);       // Print text to LCD, 1st row, 1st column
  Delay_ms(1000);
  LCD_Out(2,6,"mikroE");    // Print text to LCD, 2nd row, 6th column
}
especially, first line and third line.

Thank Guys
Hello,

first of all, I want to suggest you to download newer version of mikroC PRO compiler for PIC v3.8:
http://www.mikroe.com/eng/downloads/get ... _setup.zip

Also, on following link, you can read more about LCD library, and find explanation about your code:
http://www.mikroe.com/esupport/index.ph ... icleid=137

I hope that this will help you.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

Post Reply

Return to “mikroC General”