178 lines
12 KiB
HTML
178 lines
12 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.14"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>SSD1306Ascii: Arduino SSD1306Ascii Library</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">SSD1306Ascii
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Arduino SSD1306Ascii Library </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><center>Copyright © 2015 by William Greiman </center><h1><a class="anchor" id="Intro"></a>
|
|
Introduction</h1>
|
|
<p>This library is in early development so the API and features may change. The library is likely to have bugs and be unstable. The purpose for this release is to get feedback for future development.</p>
|
|
<p>The Arduino SSD1306Ascii Library is designed to display text on small monochrome OLED displays. These displays are available on ebay at very low cost.</p>
|
|
<p>The library is being developed using 0.96" and 1.3" displays with SSD1306 controllers. An initialization sequence for SH1106 controllers is included.</p>
|
|
<p>There are many existing full featured graphics libraries for these displays. The goal for this library is to only display text with minimum use of RAM and flash.</p>
|
|
<p>Here are key design goals:</p>
|
|
<p>Small size is the highest priority. Speed and features are lower priority.</p>
|
|
<p>Support multiple fonts. More than 40 fonts are included with this release. Fonts are only loaded if you reference them.</p>
|
|
<p>Support fixed width and proportional fonts.</p>
|
|
<p>Optionally magnify fonts by a factor of two.</p>
|
|
<p>Support 128x32 and 128x64 displays with I2C and SPI interfaces. <br />
|
|
Use the standard Wire library for I2C. An optimization option is available to increase I2C performance.</p>
|
|
<p>Use the standard SPI library for hardware SPI. An optimization option is available for AVR to increase performance and reduce code size.</p>
|
|
<p>Provide software SPI so the display can be connected to any digital pins.</p>
|
|
<h1><a class="anchor" id="Install"></a>
|
|
Installation</h1>
|
|
<p>You can manually install the SSD1306Ascii library by copying the SSD1306Ascii folder from the download package to the Arduino libraries folder in your sketch folder.</p>
|
|
<p>See the Manual installation section of this guide.</p>
|
|
<p><a href="http://arduino.cc/en/Guide/Libraries">http://arduino.cc/en/Guide/Libraries</a></p>
|
|
<p>The library will be added to the Arduino Library Manager soon.</p>
|
|
<h1><a class="anchor" id="Scroll"></a>
|
|
Scroll Mode</h1>
|
|
<p>Scroll mode causes the display to scroll up when a new line is written to the display.</p>
|
|
<p>Scroll mode is configured by editing <a class="el" href="_s_s_d1306_ascii_8h.html" title="Base class for ssd1306 displays. ">SSD1306Ascii.h</a>.</p>
|
|
<p>If INCLUDE_SCROLLING is defined to be zero, new line will not scroll the display and code for scrolling will not be included. This option will save some code space and one byte of RAM.</p>
|
|
<p>If INCLUDE_SCROLLING is defined to be one, the scroll feature will be included but not enabled. A call to setScroll() will be required to enable scrolling.</p>
|
|
<p>If INCLUDE_SCROLLING is defined to be two, the scroll feature will be included and enabled. A call to setScroll() will be required to disable scrolling.</p>
|
|
<p>Scroll mode is only supported on 64 pixel high displays.</p>
|
|
<p>Call setScroll() to enable or disable scroll mode.</p>
|
|
<p>Calls to setCursor(), setRow() and other cursor positioning functions will be unpredictable in scroll mode.</p>
|
|
<p>The clear() call will erase the display and start at the top of the display.</p>
|
|
<p>See the ScrollSpi and ScrollWire examples.</p>
|
|
<h1><a class="anchor" id="Fonts"></a>
|
|
Fonts</h1>
|
|
<p>Fonts are defined by .h files in the SSD1306Ascii/src/fonts folder. The fonts folder contains all fonts from openGLCD plus a number of extra fonts.</p>
|
|
<p>To select a font, call the setFont() member function like this. </p><div class="fragment"><div class="line"><span class="comment">// Select the font used in the Adafruit GFX Graphics Library.</span></div><div class="line">oled.setFont(Adafruit5x7); </div></div><!-- fragment --><p> Only fonts referenced in your program will be loaded into flash.</p>
|
|
<p>Here are symbols for fixed width fonts. </p><pre class="fragment">Adafruit5x7
|
|
cp437font8x8
|
|
fixed_bold10x15
|
|
fixednums15x31
|
|
fixednums7x15
|
|
fixednums8x16
|
|
font5x7
|
|
font8x8
|
|
lcd5x7
|
|
lcdnums12x16
|
|
lcdnums14x24
|
|
newbasic3x5
|
|
Stang5x7
|
|
System5x7
|
|
Wendy3x5
|
|
X11fixed7x14
|
|
X11fixed7x14B
|
|
ZevvPeep8x16
|
|
</pre><p>Here are symbols for proportional fonts. Note that Iain5x7 and utf8font10x16 are proportional. </p><pre class="fragment">Arial14
|
|
Arial_bold_14
|
|
CalBlk36
|
|
CalLite24
|
|
Callibri10
|
|
Callibri11
|
|
Callibri11_bold
|
|
Callibri11_italic
|
|
Callibri14
|
|
Callibri15
|
|
Cooper19
|
|
Cooper21
|
|
Cooper26
|
|
Corsiva_12
|
|
Iain5x7
|
|
Roosewood22
|
|
Roosewood26
|
|
TimesNewRoman13
|
|
TimesNewRoman13_italic
|
|
TimesNewRoman16
|
|
TimesNewRoman16_bold
|
|
TimesNewRoman16_italic
|
|
utf8font10x16
|
|
Verdana12
|
|
Verdana12_bold
|
|
Verdana12_italic
|
|
Verdana_digits_24
|
|
</pre><p>See allFonts.h for more information on adding a font.</p>
|
|
<p>The set2X() call doubles the size of characters. Each pixel becomes a 2x2 square. To return to standard size characters call set1X(); </p><div class="fragment"><div class="line">oled.set2X();</div><div class="line"><span class="comment">// Display double height and width characters.</span></div><div class="line"></div><div class="line">...</div><div class="line"></div><div class="line"><span class="comment">// Return to standard size.</span></div><div class="line">oled.set1X();</div></div><!-- fragment --><h1><a class="anchor" id="config"></a>
|
|
SSD1306Ascii Configuration</h1>
|
|
<p>Several configuration options may be changed by editing the <a class="el" href="_s_s_d1306_ascii_8h.html" title="Base class for ssd1306 displays. ">SSD1306Ascii.h</a> file in the SSD1306Ascii/src folder.</p>
|
|
<p>These options are at the start of the file.</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// Configuration options.</span></div><div class="line"><span class="comment">/* Set Scrolling mode for new line.</span></div><div class="line"><span class="comment"> </span></div><div class="line"><span class="comment"> * If INCLUDE_SCROLLING is defined to be zero, new line will not scroll</span></div><div class="line"><span class="comment"> * the display and code for scrolling will not be included. This option </span></div><div class="line"><span class="comment"> * will save some code space and one byte of RAM.</span></div><div class="line"><span class="comment"> </span></div><div class="line"><span class="comment"> * If INCLUDE_SCROLLING is defined to be one, the scroll feature will</span></div><div class="line"><span class="comment"> * be included but not enabled. A call to setScroll() will be required</span></div><div class="line"><span class="comment"> * to enable scrolling.</span></div><div class="line"><span class="comment"> </span></div><div class="line"><span class="comment"> * If INCLUDE_SCROLLING is defined to be two, the scroll feature will</span></div><div class="line"><span class="comment"> * be included and enabled. A call to setScroll() will be required</span></div><div class="line"><span class="comment"> * to disable scrolling.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="preprocessor">#define INCLUDE_SCROLLING 1</span></div><div class="line"></div><div class="line"><span class="comment">/* Use larger faster I2C code. */</span></div><div class="line"><span class="preprocessor">#define OPTIMIZE_I2C 1</span></div><div class="line"></div><div class="line"><span class="comment">/* Define OPTIMIZE_AVR_SPI non-zero for a faster smaller AVR SPI code.</span></div><div class="line"><span class="comment"> * Warning AVR will not use SPI transactions.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="preprocessor">#define OPTIMIZE_AVR_SPI 1</span></div></div><!-- fragment --><h1><a class="anchor" id="Documentation"></a>
|
|
Documentation</h1>
|
|
<p>Please see the Classes tab for more information.</p>
|
|
<p>For I2C displays using the wire library Wire see the <a class="el" href="class_s_s_d1306_ascii_wire.html" title="Class for I2C displays using Wire. ">SSD1306AsciiWire</a> class.</p>
|
|
<p>For I2C displays using the small <a class="el" href="class_avr_i2c.html" title="Hardware I2C master class for AVR. ">AvrI2c</a> class see the <a class="el" href="class_s_s_d1306_ascii_avr_i2c.html" title="Class for I2C displays on AVR. ">SSD1306AsciiAvrI2c</a> class.</p>
|
|
<p>For SPI displays connected to the Arduino hardware SPI pins see the <a class="el" href="class_s_s_d1306_ascii_spi.html" title="Class for SPI displays on the hardware SPI bus. ">SSD1306AsciiSpi</a> class.</p>
|
|
<p>See the <a class="el" href="class_s_s_d1306_ascii_soft_spi.html" title="Class for SPI displays using software SPI. ">SSD1306AsciiSoftSpi</a> class for use of Software SPI.</p>
|
|
<h1><a class="anchor" id="comment"></a>
|
|
Bugs and Comments</h1>
|
|
<p>If you wish to report bugs or have comments, open an issue on GitHub or send email to <a href="#" onclick="location.href='mai'+'lto:'+'fat'+'16'+'lib'+'@s'+'bcg'+'lo'+'bal'+'.n'+'et'; return false;">fat16<span style="display: none;">.nosp@m.</span>lib@<span style="display: none;">.nosp@m.</span>sbcgl<span style="display: none;">.nosp@m.</span>obal<span style="display: none;">.nosp@m.</span>.net</a>. If possible, include a simple program that illustrates the bug or problem.</p>
|
|
<h1><a class="anchor" id="ExampleS"></a>
|
|
Examples</h1>
|
|
<p>A number of examples are provided in the SSD1306Ascii/examples folder.</p>
|
|
<p>To access these examples from the Arduino development environment go to: File -> Examples -> SSD1306Ascii -> <program Name></p>
|
|
<p>Compile and upload to your Arduino to run the example. </p>
|
|
</div></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Sun Jun 10 2018 08:59:22 for SSD1306Ascii by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.14
|
|
</small></address>
|
|
</body>
|
|
</html>
|