-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_draw_pixels_8ino-example.html
More file actions
75 lines (73 loc) · 10.8 KB
/
_draw_pixels_8ino-example.html
File metadata and controls
75 lines (73 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Lucky Resistors AS1130 Library: DrawPixels.ino</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">Lucky Resistors AS1130 Library
</div>
<div id="projectbrief">This is a library to access the functionality of the AS1130 chip.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</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">DrawPixels.ino</div> </div>
</div><!--header-->
<div class="contents">
<p>This is an example how to scroll multiple frames.</p>
<div class="fragment"><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Lucky Resistor's AS1130 Library</span></div><div class="line"><span class="comment">// ---------------------------------------------------------------------------</span></div><div class="line"><span class="comment">// (c)2017 by Lucky Resistor. See LICENSE for details.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// This program is free software: you can redistribute it and/or modify</span></div><div class="line"><span class="comment">// it under the terms of the GNU General Public License as published by</span></div><div class="line"><span class="comment">// the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><span class="comment">// (at your option) any later version.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// This program is distributed in the hope that it will be useful,</span></div><div class="line"><span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class="line"><span class="comment">// GNU General Public License for more details.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// You should have received a copy of the GNU General Public License</span></div><div class="line"><span class="comment">// along with this program. If not, see <http://www.gnu.org/licenses/></span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="preprocessor">#include "LRAS1130.h"</span></div><div class="line"></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacelr.html">lr</a>;</div><div class="line"><a name="_a0"></a><a class="code" href="classlr_1_1_a_s1130.html">AS1130</a> ledDriver;</div><div class="line"></div><div class="line"></div><div class="line"><a name="_a1"></a><a class="code" href="classlr_1_1_a_s1130_picture24x5.html">AS1130Picture24x5</a> picture1;</div><div class="line"><a class="code" href="classlr_1_1_a_s1130_picture24x5.html">AS1130Picture24x5</a> picture2;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> setup() {</div><div class="line"> Wire.begin();</div><div class="line"> Serial.begin(115200);</div><div class="line"> </div><div class="line"> <span class="comment">// Wait until the chip is ready.</span></div><div class="line"> delay(100); </div><div class="line"> Serial.println(F(<span class="stringliteral">"Initialize chip"</span>));</div><div class="line"> </div><div class="line"> <span class="comment">// Check if the chip is addressable.</span></div><div class="line"> <span class="keywordflow">if</span> (!ledDriver.<a name="a2"></a><a class="code" href="classlr_1_1_a_s1130.html#a73cc99a556f9a8e46fe94f609a9bb5ae">isChipConnected</a>()) {</div><div class="line"> Serial.println(F(<span class="stringliteral">"Communication problem with chip."</span>));</div><div class="line"> Serial.flush();</div><div class="line"> <span class="keywordflow">return</span>;</div><div class="line"> }</div><div class="line"></div><div class="line"> picture1.<a name="a3"></a><a class="code" href="classlr_1_1_a_s1130_picture24x5.html#a5e4217a56f28913f0174246d1ac067c4">setPixel</a>(0, 0, <span class="keyword">true</span>);</div><div class="line"> picture1.<a class="code" href="classlr_1_1_a_s1130_picture24x5.html#a5e4217a56f28913f0174246d1ac067c4">setPixel</a>(1, 1, <span class="keyword">true</span>);</div><div class="line"> picture1.<a class="code" href="classlr_1_1_a_s1130_picture24x5.html#a5e4217a56f28913f0174246d1ac067c4">setPixel</a>(2, 2, <span class="keyword">true</span>);</div><div class="line"></div><div class="line"> picture2.<a class="code" href="classlr_1_1_a_s1130_picture24x5.html#a5e4217a56f28913f0174246d1ac067c4">setPixel</a>(10, 0, <span class="keyword">true</span>);</div><div class="line"> picture2.<a class="code" href="classlr_1_1_a_s1130_picture24x5.html#a5e4217a56f28913f0174246d1ac067c4">setPixel</a>(9, 1, <span class="keyword">true</span>);</div><div class="line"> picture2.<a class="code" href="classlr_1_1_a_s1130_picture24x5.html#a5e4217a56f28913f0174246d1ac067c4">setPixel</a>(8, 2, <span class="keyword">true</span>);</div><div class="line"></div><div class="line"> <span class="comment">// Set-up everything.</span></div><div class="line"> ledDriver.<a name="a4"></a><a class="code" href="classlr_1_1_a_s1130.html#aaec9e5f2c295080f9468fb0763bd6238">setRamConfiguration</a>(<a name="a5"></a><a class="code" href="classlr_1_1_a_s1130.html#ae76a6d2a7b90b3e167af0c70c9f23efeae26afe23b5c21199bdbdfbeb9dd3ca0e">AS1130::RamConfiguration1</a>);</div><div class="line"> ledDriver.<a name="a6"></a><a class="code" href="classlr_1_1_a_s1130.html#a44aae60edee54eaa9a586c9e15b29f1a">setOnOffFrameAllOff</a>(0);</div><div class="line"> ledDriver.<a name="a7"></a><a class="code" href="classlr_1_1_a_s1130.html#a6f029652ba8babd76861a1f9ab55b791">setBlinkAndPwmSetAll</a>(0);</div><div class="line"> ledDriver.<a name="a8"></a><a class="code" href="classlr_1_1_a_s1130.html#a3a49179c5012ab0793ccb76f6c47b9be">setCurrentSource</a>(<a name="a9"></a><a class="code" href="classlr_1_1_a_s1130.html#a1162fd7e210bd57e44f1bebe54930eebab8e38ca588887aa0b74c59148870cc36">AS1130::Current30mA</a>);</div><div class="line"> ledDriver.<a name="a10"></a><a class="code" href="classlr_1_1_a_s1130.html#ac84e3c7d6c174c9d87a79c463cb5c652">setScanLimit</a>(<a name="a11"></a><a class="code" href="classlr_1_1_a_s1130.html#a7951d69e6adace490427fcbc40cc2f05a1807a38eb82f68b80d0fb5ac16a35c0d">AS1130::ScanLimitFull</a>);</div><div class="line"> ledDriver.<a name="a12"></a><a class="code" href="classlr_1_1_a_s1130.html#a7ac9548ba0db3f15f0f963e0cfdf9e56">setMovieEndFrame</a>(<a name="a13"></a><a class="code" href="classlr_1_1_a_s1130.html#aacd5515456ddb07b38634e4771ad70a1a70f9526f7d61a3b52c8a96c4d79fb7f1">AS1130::MovieEndWithFirstFrame</a>);</div><div class="line"> ledDriver.<a name="a14"></a><a class="code" href="classlr_1_1_a_s1130.html#ae477a75e779e35a15d273bce764713e5">setMovieFrameCount</a>(4);</div><div class="line"> ledDriver.<a name="a15"></a><a class="code" href="classlr_1_1_a_s1130.html#a5135cd834fd199c12de2bcaecdf6a441">setFrameDelayMs</a>(100);</div><div class="line"> ledDriver.<a name="a16"></a><a class="code" href="classlr_1_1_a_s1130.html#a966fee6a32cdc8a85760546e5006f5e7">setMovieLoopCount</a>(<a name="a17"></a><a class="code" href="classlr_1_1_a_s1130.html#a226377a5739a8ff1ee4e219f8c861b0ca200156e2467e43f88ff480e9eb59cbf1">AS1130::MovieLoop6</a>);</div><div class="line"> ledDriver.<a name="a18"></a><a class="code" href="classlr_1_1_a_s1130.html#a1d8bf3eeb9bc70022ece09aef5b11197">setScrollingEnabled</a>(<span class="keyword">true</span>);</div><div class="line"> ledDriver.<a name="a19"></a><a class="code" href="classlr_1_1_a_s1130.html#a83bc7ee667929ee006cf2906953e4f50">startPicture</a>(0);</div><div class="line"> </div><div class="line"> <span class="comment">// Enable the chip</span></div><div class="line"> ledDriver.<a name="a20"></a><a class="code" href="classlr_1_1_a_s1130.html#aa5273e596b91da8c55a13d1aa74ccffe">startChip</a>();</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> loop() {</div><div class="line"> ledDriver.<a name="a21"></a><a class="code" href="classlr_1_1_a_s1130.html#a34878bfeb1010c5c6034c5aa6dc218e4">setOnOffFrame</a>(0, picture1);</div><div class="line"> delay(800);</div><div class="line"> ledDriver.<a class="code" href="classlr_1_1_a_s1130.html#a34878bfeb1010c5c6034c5aa6dc218e4">setOnOffFrame</a>(0, picture2);</div><div class="line"> delay(800);</div><div class="line">}</div><div class="line"></div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>