ysuga / colorlcdshield Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sparkfun/colorlcdshield
This is an Arduino library for SparkFun's Color LCD Shield
Home Page: http://www.sparkfun.com/products/9363
This project forked from sparkfun/colorlcdshield
This is an Arduino library for SparkFun's Color LCD Shield
Home Page: http://www.sparkfun.com/products/9363
************************************ * * * ColorLCDShield * * * * an Arduino Library * * * * by Jim Lindblom * * SparkFun Electronics * * * ************************************ License: CC-BY SA 3.0 - Creative commons share-alike 3.0 use this code however you'd like, just keep this license and attribute. Let me know if you make hugely, awesome, great changes. Huge thanks to Jim Lynch, Mark Sproul, and Peter Davenport. If I'm missing anyone, I apologize, all of this code's been through the ringer more than a few times. This is a (hopefully) simple Arduino library for use specifically with SparkFun Electronics' Color LCD Shield (http://www.sparkfun.com/products/9363). It'll no doubt work with other incarnations of LCD breakouts and what not, you just might have to do some modifying of the pin defintions. The code gives you access to the following LCD functions: LCDShield(); - The library's constructor. An instance of the lcd must be created at the beginning of any code. e.g: LCDShield lcd; void init(int type); - This initializes an LCD. Either EPSON or PHILLIPS should be passed as the type variable. This function should be called near the beginning of any function (setup()!). Turns on the display, sets the contrast and uinitializes the LCD into 12-bit RGB color mode. void clear(int color); - Clears the entire screen, filling it with the 12-bit RGB color passed to it. There are a number of predefined colors in ColorLCDShield.h void contrast(char setting); - Manually adjusts the contrast. A value between 0 and 60 should be passed. 40 works pretty well for me. void setPixel(int color, unsigned char x, unsigned char y); - Draws a single pixel at the specified x, y location. Color is a 12-bit RGB value. void setCircle (int x0, int y0, int radius, int color); - Draws a circle centered around x0, y0, of the specified radius and color. Radius is in pixels, color is a 12-bit RGB value. void setChar(char c, int x, int y, int fColor, int bColor); - Sets a single character down at the specified x/y coordinate. You can pick both the foreground and background color, they're 12-bit RGB values. Only one font is available in this library. Definitely room for growth, though at an added cost of memory. void setStr(char *pString, int x, int y, int fColor, int bColor); - Sets a string of characters down, beginning at x/y coordinates. You can pick both the foreground and background color, they're 12-bit RGB values. Only one font is available in this library. Definitely room for growth, though at an added cost of memory. void setLine(int x0, int y0, int x1, int y1, int color); - Draws a line from x0,y0 to x1,y1. Color is a 12-bit RGB value. void setRect(int x0, int y0, int x1, int y1, unsigned char fill, int color); - Draws a rectangle with opposing corners at x0,y0 and x1,y1. A 1 for fill will fill the entire rectangle, a 0 will only draw the border. Color is a 12-bit RGB value. void printLogo(void); - One trick pony. Prints the SparkFun logo. void on(void); - Turns the display on. void off(void); - Turns the display off. You'll still see the backlight on!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.