User Tools

Site Tools


tutorials:gfx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorials:gfx [2012/04/09 22:09]
pburgess [Coordinate System and Units]
tutorials:gfx [2012/05/10 17:08]
pburgess [Overview]
Line 3: Line 3:
 The Adafruit_GFX library for Arduino provides a common syntax and set of graphics functions for all of our LCD and OLED displays. This allows Arduino sketches to easily be adapted between display types with minimal fuss…and any new features, performance improvements and bug fixes will immediately apply across our complete offering of color displays. The Adafruit_GFX library for Arduino provides a common syntax and set of graphics functions for all of our LCD and OLED displays. This allows Arduino sketches to easily be adapted between display types with minimal fuss…and any new features, performance improvements and bug fixes will immediately apply across our complete offering of color displays.
  
-The Adafruit_GFX library works together with a second library provided for each specific display type — for example, the ST7735 1.8" color LCD requires installing both the Adafruit_GFX and Adafruit_ST7735 libraries. [[http://​www.ladyada.net/​library/​arduino/​libraries.html|For information how to use and install libraries, see our tutorial!]]+The Adafruit_GFX library works together with a second library provided for each specific display type — for example, the ST7735 1.8" color LCD requires installing both the Adafruit_GFX and Adafruit_ST7735 libraries. ​The following libraries now operate in this manner: 
 + 
 +  * [[https://​github.com/​adafruit/​RGB-matrix-Panel|RGBmatrixPanel]],​ for our [[http://​www.adafruit.com/​products/​420|16x32]] and [[http://​www.adafruit.com/​products/​607|32x32]] RGB LED matrix panels. 
 +  * [[https://​github.com/​adafruit/​TFTLCD-Library|Adafruit_TFTLCD]],​ for our 2.8" [[http://​www.adafruit.com/​products/​335|TFT LCD touchscreen breakout]] and [[http://​www.adafruit.com/​products/​376|TFT Touch Shield for Arduino]]. 
 +  * [[https://​github.com/​adafruit/​Adafruit-HX8340B|Adafruit_HX8340B]],​ for our [[http://​www.adafruit.com/​products/​797|2.2"​ TFT Display with microSD]]. 
 +  * [[https://​github.com/​adafruit/​Adafruit-ST7735-Library|Adafruit_ST7735]],​ for our [[http://​www.adafruit.com/​products/​358|1.8"​ TFT Display with microSD]]. 
 +  * [[https://​github.com/​adafruit/​Adafruit-PCD8544-Nokia-5110-LCD-library|Adafruit_PCD8544]],​ for the [[http://​www.adafruit.com/​products/​338|Nokia 5110/3310 monochrome LCD]]. 
 +  * [[https://​github.com/​adafruit/​Adafruit-Graphic-VFD-Display-Library|Adafruit-Graphic-VFD-Display-Library]],​ for our [[https://​www.adafruit.com/​products/​773|128x64 Graphic VFD]]. 
 +  * [[https://​github.com/​adafruit/​Adafruit-SSD1331-OLED-Driver-Library-for-Arduino|Adafruit-SSD1331-OLED-Driver-Library-for-Arduino]] for the [[http://​www.adafruit.com/​products/​684|0.96"​ 16-bit Color OLED w/microSD Holder]]. 
 +  * [[https://​github.com/​adafruit/​Adafruit_SSD1306|Adafruit_SSD1306]] for the Monochrome [[https://​www.adafruit.com/​products/​326|128x64]] and [[https://​www.adafruit.com/​products/​661|128x32]] OLEDs. 
 + 
 +[[http://​www.ladyada.net/​library/​arduino/​libraries.html|For information how to use and install libraries, see our tutorial!]]
  
 The libraries are written in C++ for Arduino but could easily be ported to any microcontroller by rewriting the low-level pin access functions. The libraries are written in C++ for Arduino but could easily be ported to any microcontroller by rewriting the low-level pin access functions.
Line 124: Line 135:
 void setTextColor(uint16_t color, uint16_t backgroundcolor);​ void setTextColor(uint16_t color, uint16_t backgroundcolor);​
 void setTextSize(uint8_t size); void setTextSize(uint8_t size);
 +void setTextWrap(boolean w);
 </​code>​ </​code>​
  
Line 132: Line 144:
 After setting everything up, you can use ''​print()''​ or ''​println()''​ — //just like you do with Serial printing!// For example, to print a string, use ''​print("​Hello world"​)''​ - that’s the first line of the image above. You can also use ''​print()''​ for numbers and variables — the second line above is the output of ''​print(1234.56)''​ and the third line is ''​print(0xDEADBEEF,​ HEX)''​. After setting everything up, you can use ''​print()''​ or ''​println()''​ — //just like you do with Serial printing!// For example, to print a string, use ''​print("​Hello world"​)''​ - that’s the first line of the image above. You can also use ''​print()''​ for numbers and variables — the second line above is the output of ''​print(1234.56)''​ and the third line is ''​print(0xDEADBEEF,​ HEX)''​.
  
 +By default, long lines of text are set to automatically “wrap” back to the leftmost column. To override this behavior (so text will run off the right side of the display — useful for scrolling marquee effects), use setTextWrap(false). The normal wrapping behavior is restored with setTextWrap(true).
 ===== Bitmaps ===== ===== Bitmaps =====
  
/home/ladyada/public_html/wiki/data/pages/tutorials/gfx.txt · Last modified: 2016/01/28 18:05 (external edit)