GithubHelp home page GithubHelp logo

ysuga / colorlcdshield Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sparkfun/colorlcdshield

1.0 2.0 0.0 93 KB

This is an Arduino library for SparkFun's Color LCD Shield

Home Page: http://www.sparkfun.com/products/9363

C++ 69.55% Java 30.45%

colorlcdshield's Introduction

	************************************
	*                                  *
	*          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!

colorlcdshield's People

Contributors

tc- avatar ysuga avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.