CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Built in library help

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
wb9ixs



Joined: 02 Mar 2014
Posts: 1
Location: Wales, WI

View user's profile Send private message

Built in library help
PostPosted: Sun Jan 14, 2018 6:49 am     Reply with quote

Hello,
I am new to the CCS C IDE I have been using MikroC Pro for several years. I am having some trouble finding the details regarding the built in libraries for the CCS C. For example I was going to experiment with a LCD and found an example on the internet and in that article they explained how the different LCD commands worked. No where in the CCS C reference manual did I find the matching explanations. So I have come to the conclusion that I don't no where to look. Here is an example of what I found in the article:

lcd_putc(c)
This function will display c on the next cursor position of the LCD. You can print strings and characters using this function. You can also use following backslash character constants for sending different commands to LCD.

\\a – To set cursor to the upper left
\\f – To clear display and set cursor to upper left
\\n – To go to start of next line
\\b – To move back one position

Has anyone found anything like this in any CCS C reference material?

Thanks
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 14, 2018 7:08 am     Reply with quote

OK, I have an older version of the compiler and lcd_putc() is NOT a CCS listed function. It's actually part of an LCD driver. Usually 'drivers' will have comments or explanations buried within them. Drivers can be simple or complicated and there's probably 1,000 different drivers for text based LCD modules. The more complicated the driver, the more space it'll take up so if you don't use 80% of a driver, normally you'll delete that code to save space.
As for the LCD commands you refer to, they can be 'generic' or common to _most_ LCD modules BUT you need to read the LCD modules datasheet to confirm!
While it's obvious that a 4x20 display can access more than a 2x16, it's up to you to be sure the driver is compatible with your display.

Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 14, 2018 7:30 am     Reply with quote

Quote:
Built in library

lcd_putc() is not part of a built-in library. #use i2c(), #use rs232(), etc.
are built-in libraries. lcd_putc() is part of the lcd.c driver file. Driver
files have the documentation for them in comments at the top of the file.
Usually.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 14, 2018 8:27 am     Reply with quote

Usually.

that's the keyword !

Old school asm programmers will comment every line of code, even the obvious stuff.
Some programmers won't comment at all.
Some assume you KNOW what the device is, how it works and the bits, registers, commands needed to 'make it work'.
Some only code for what they need, not what the device can do.
So it's all down to reading the device datasheets, FAQs and then cutting code.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sun Jan 14, 2018 9:58 am     Reply with quote

and (of course), for a simple text LCD, many users here will recommend PCM_programmer's 'flex_lcd' library (in the code library part of this forum), rather than the CCS supplied library.
It is very reliable, & flexible. Smile

Doesn't support \a, but does support \f, \n and \b.

For \a, it has a lcd_gotoxy, which allows you to position to any row/column.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group