tag:blogger.com,1999:blog-45232572644805898882024-03-05T10:45:37.026+03:00РоботушкаAnonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-4523257264480589888.post-17019193822966812852017-11-06T01:07:00.000+03:002017-11-06T01:07:08.934+03:00Подключение мотора постоянного тока через переменный резистор<div dir="ltr" style="text-align: left;" trbidi="on">
Мотор подключил аналогично <a href="http://robotclass.ru/tutorials/arduino-dc-motor-driver/">схеме с транзистором</a>.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWwyNJLYW_Inq4mkxx-kLa4YJvLuyrrkeZ9DvccSzMxmrYcn5bJBojFjuCrR2OIE6TsUozpACCLE-3_QAENCHFcw4p8uwAKNy4rl74LDmTFbN8Kl1RJasd7Q8A7v0elAen0_8dvRHmwwc/s1600/DSC_0606.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWwyNJLYW_Inq4mkxx-kLa4YJvLuyrrkeZ9DvccSzMxmrYcn5bJBojFjuCrR2OIE6TsUozpACCLE-3_QAENCHFcw4p8uwAKNy4rl74LDmTFbN8Kl1RJasd7Q8A7v0elAen0_8dvRHmwwc/s320/DSC_0606.JPG" width="320" /></a></div>
<span id="goog_1618558666"></span><span id="goog_1618558667"></span><br />
Поскольку тут не участвует контроллер, то тут без транзистора. Вместо контроллера - переменный резистор (крутилка). Скорость вращения зависит от уровня напряжения, подаваемого на контакты мотора. Этим уровнем и управляем через переменный резистор.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/J3pzIF1KnpM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/J3pzIF1KnpM?feature=player_embedded" width="320"></iframe></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-86058623966565613992014-06-03T01:18:00.002+04:002014-06-03T01:24:13.589+04:00Space Invaders on Launchpad<div dir="ltr" style="text-align: left;" trbidi="on">
В рамках курса сделал последнюю лабораторную. А сейчас мне попался интересный редактор схем Fritzing и я попробовал нарисовать на нем получившуюся схему.<br />
<div>
Кстати, сами пришельцы выглядят так:</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/B19dcWMzqkU?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<a name='more'></a>Вот схема:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVdMLDWYMz0jlt0Kx_zT_zjdcHDuHNzY7myxqX1IrotnLv4t_qPYRizHyUp2KQRN4IIcodFIDzxAxAs2X1ltu0dBvtsfIIb1whacz-YbbkiXSh68eoDE6qB9TQAdKEXnzhsUmDEN3TeKw/s1600/40_pin_BoosterPack_template_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVdMLDWYMz0jlt0Kx_zT_zjdcHDuHNzY7myxqX1IrotnLv4t_qPYRizHyUp2KQRN4IIcodFIDzxAxAs2X1ltu0dBvtsfIIb1whacz-YbbkiXSh68eoDE6qB9TQAdKEXnzhsUmDEN3TeKw/s1600/40_pin_BoosterPack_template_bb.png" height="282" width="320" /></a></div>
<div>
<br /></div>
<div>
С помощью переменного резистора перемещается наш боевой корабль. Левая кнопка - огонь. Правая - старт/пауза. Звук на пищалку идет через 4-битный ЦАП. Экран - от Nokia 5110.</div>
<div>
<br /></div>
<div>
Исходник схемы можно взять <a href="http://fritzing.org/projects/space-invaders">тут</a>.</div>
<div>
А исходники программы - на <a href="https://github.com/iriscrm/SpaceInvaders">гитхабе</a>, код не причесывал.</div>
</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com1tag:blogger.com,1999:blog-4523257264480589888.post-78585067435020573152014-03-20T17:31:00.001+04:002014-05-03T22:26:06.022+04:00LaunchPad + Nokia 5110 display<div dir="ltr" style="text-align: left;" trbidi="on">
Попробовал подключить дисплей от <a href="http://www.aliexpress.com/item/free-shipping-Blue-microcontroller-development-board-5110-LCD-module-Compatible-Nokia-3310/1256466494.html" rel="nofollow">Nokia 5110</a> к <a href="http://0.0.7.222/01/launchpad-texas-instruments.html">Launchpad</a>. Что приятно, преподаватели <a href="https://www.edx.org/course/utaustinx/utaustinx-ut-6-01x-embedded-systems-1172" rel="nofollow">курса</a> позаботились и приготовили примерчик с готовыми библиотеками для работы с этим экраном. Поэтому кроме собственно подключения экрана делать ничего не пришлось. И на экране появилась вот такая рогатая морда.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/6lC-JzMqkA0?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<a name='more'></a><br />
После этого начинает выводиться текстовая информация.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCBjv6wRC2vjGu-yio0Hp7VyULX1mGJlbGmU2DKEuCjSrzVZVih6gudvegKAScKQ9k5szcnmtPke3fh2ViojHbivCeFqWdydsJdCM7nTYg286rkOLP9WBy-gxpz-RUvNxhbxT7GztFr2c/s1600/DSC_2283.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCBjv6wRC2vjGu-yio0Hp7VyULX1mGJlbGmU2DKEuCjSrzVZVih6gudvegKAScKQ9k5szcnmtPke3fh2ViojHbivCeFqWdydsJdCM7nTYg286rkOLP9WBy-gxpz-RUvNxhbxT7GztFr2c/s1600/DSC_2283.JPG" height="240" width="320" /></a></div>
<br />
Пару слов про подключение. Экран работает от 3 или 5 вольт. Как сказано в описании у продавца:<br />
<blockquote class="tr_bq">
VCC - power input (3.3 v and 5 v, through experimental verification, there is no problem)</blockquote>
Ланчпад как раз даёт 3.3V. Ну я и подключил на VCC 3.3V. В итоге получил тусклое, еле различимое изображение. Сперва подумал, что брак у экрана. А потом сообразил, что я новичок и наверняка туплю. Посмотрел маркировку на экране, там написано 3-5V. Может быть мои 3.3V схема экрана приняла за 5V? Попробовал понизить напряжение и подключил питание через сопротивление и всё заработало нормально. О как.<br />
<br />
Подсветка подключена тоже через ограничивающее сопротивление, чтобы ток был не более 80мА. Ланчпад, <a href="http://www.ti.com/lit/pdf/spmu296" rel="nofollow">судя по описанию</a>, дает до 300мА. У меня оба сопротивления на 220 Ом, так как меньше не было.<br />
<br />
Ниже - тексты программы и библиотек, любезно предоставленные преподавателями.<br />
<br />
Это сама программа.<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">// Nokia5110TestMain.c</span>
<span style="color: #aeaeae; font-style: italic;">// Runs on LM4F120/TM4C123</span>
<span style="color: #aeaeae; font-style: italic;">// Test the functions in Nokia5110.c by printing various</span>
<span style="color: #aeaeae; font-style: italic;">// things to the LCD.</span>
<span style="color: #aeaeae; font-style: italic;">// Daniel Valvano</span>
<span style="color: #aeaeae; font-style: italic;">// September 16, 2013</span>
<span style="color: #aeaeae; font-style: italic;">// Font table, initialization, and other functions based</span>
<span style="color: #aeaeae; font-style: italic;">// off of Nokia_5110_Example from Spark Fun:</span>
<span style="color: #aeaeae; font-style: italic;">// 7-17-2011</span>
<span style="color: #aeaeae; font-style: italic;">// Spark Fun Electronics 2011</span>
<span style="color: #aeaeae; font-style: italic;">// Nathan Seidle</span>
<span style="color: #aeaeae; font-style: italic;">// http://dlnmh9ip6v2uc.cloudfront.net/datasheets/LCD/Monochrome/Nokia_5110_Example.pde</span>
<span style="color: #aeaeae; font-style: italic;">/* This example accompanies the book
"Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2013
Copyright 2013 by Jonathan W. Valvano, valvano@mail.utexas.edu
You may use, edit, run or distribute this file
as long as the above copyright notice remains
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
For more information about my classes, my research, and my books, see
http://users.ece.utexas.edu/~valvano/
*/</span>
<span style="color: #aeaeae; font-style: italic;">// Blue Nokia 5110</span>
<span style="color: #aeaeae; font-style: italic;">// ---------------</span>
<span style="color: #aeaeae; font-style: italic;">// Signal (Nokia 5110) LaunchPad pin</span>
<span style="color: #aeaeae; font-style: italic;">// Reset (RST, pin 1) connected to PA7</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Fss (CE, pin 2) connected to PA3</span>
<span style="color: #aeaeae; font-style: italic;">// Data/Command (DC, pin 3) connected to PA6</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Tx (Din, pin 4) connected to PA5</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Clk (Clk, pin 5) connected to PA2</span>
<span style="color: #aeaeae; font-style: italic;">// 3.3V (Vcc, pin 6) power</span>
<span style="color: #aeaeae; font-style: italic;">// back light (BL, pin 7) not connected</span>
<span style="color: #aeaeae; font-style: italic;">// Ground (Gnd, pin 8) ground</span>
<span style="color: #aeaeae; font-style: italic;">// Red SparkFun Nokia 5110 (LCD-10168)</span>
<span style="color: #aeaeae; font-style: italic;">// -----------------------------------</span>
<span style="color: #aeaeae; font-style: italic;">// Signal (Nokia 5110) LaunchPad pin</span>
<span style="color: #aeaeae; font-style: italic;">// 3.3V (VCC, pin 1) power</span>
<span style="color: #aeaeae; font-style: italic;">// Ground (GND, pin 2) ground</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Fss (SCE, pin 3) connected to PA3</span>
<span style="color: #aeaeae; font-style: italic;">// Reset (RST, pin 4) connected to PA7</span>
<span style="color: #aeaeae; font-style: italic;">// Data/Command (D/C, pin 5) connected to PA6</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Tx (DN, pin 6) connected to PA5</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Clk (SCLK, pin 7) connected to PA2</span>
<span style="color: #aeaeae; font-style: italic;">// back light (LED, pin 8) not connected</span>
#include <span style="color: #65b042;">"Nokia5110.h"</span>
#include <span style="color: #65b042;">"PLL.h"</span>
<span style="color: #aeaeae; font-style: italic;">// function delays 3*ulCount cycles</span>
<span style="color: #dad085;">void</span> Delay(unsigned long ulCount){
<span style="color: #e28964;">do</span>{
ulCount<span style="color: #e28964;">-</span><span style="color: #e28964;">-</span>;
}<span style="color: #e28964;">while</span>(ulCount);
}
<span style="color: #aeaeae; font-style: italic;">// image of a longhorn</span>
const char Longhorn[] <span style="color: #e28964;">=</span> {
<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x70</span>, <span style="color: #3387cc;">0xF0</span>,
<span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0x70</span>,
<span style="color: #3387cc;">0x70</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0E</span>, <span style="color: #3387cc;">0x0C</span>, <span style="color: #3387cc;">0x1C</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0xB8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF0</span>,
<span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xFC</span>, <span style="color: #3387cc;">0xFC</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>,
<span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xF0</span>,
<span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0x78</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x3C</span>, <span style="color: #3387cc;">0x1C</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x06</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0F</span>,
<span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>,
<span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1E</span>, <span style="color: #3387cc;">0x0E</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x05</span>, <span style="color: #3387cc;">0x0B</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x3C</span>, <span style="color: #3387cc;">0x7F</span>, <span style="color: #3387cc;">0x7F</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x7F</span>, <span style="color: #3387cc;">0x3F</span>, <span style="color: #3387cc;">0x28</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>
};
<span style="color: #aeaeae; font-style: italic;">// image of a longhorn loves 319k</span>
const char Longhorn2[] <span style="color: #e28964;">=</span> {
<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x70</span>, <span style="color: #3387cc;">0xF0</span>,
<span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0xC0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0x70</span>,
<span style="color: #3387cc;">0x70</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0xE4</span>, <span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x08</span>,
<span style="color: #3387cc;">0xF1</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0E</span>, <span style="color: #3387cc;">0x0C</span>, <span style="color: #3387cc;">0x1C</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0xB8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF0</span>,
<span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xFC</span>, <span style="color: #3387cc;">0xFC</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>,
<span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF8</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0xF0</span>,
<span style="color: #3387cc;">0xF0</span>, <span style="color: #3387cc;">0x78</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x3C</span>, <span style="color: #3387cc;">0x1C</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0xFC</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x06</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x0F</span>,
<span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>,
<span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x1E</span>, <span style="color: #3387cc;">0x0E</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x05</span>, <span style="color: #3387cc;">0x0B</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x88</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x82</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>,
<span style="color: #3387cc;">0x84</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0xE0</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x1F</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x0F</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x88</span>, <span style="color: #3387cc;">0x88</span>, <span style="color: #3387cc;">0x8A</span>, <span style="color: #3387cc;">0x85</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>,
<span style="color: #3387cc;">0x89</span>, <span style="color: #3387cc;">0x8F</span>, <span style="color: #3387cc;">0x88</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x83</span>, <span style="color: #3387cc;">0x82</span>, <span style="color: #3387cc;">0x82</span>, <span style="color: #3387cc;">0x8F</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x8F</span>, <span style="color: #3387cc;">0x82</span>, <span style="color: #3387cc;">0x85</span>,
<span style="color: #3387cc;">0x88</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x80</span>, <span style="color: #3387cc;">0x8F</span>, <span style="color: #3387cc;">0x50</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x3C</span>, <span style="color: #3387cc;">0x7F</span>, <span style="color: #3387cc;">0x7F</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>,
<span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0xFF</span>, <span style="color: #3387cc;">0x7F</span>, <span style="color: #3387cc;">0x3F</span>, <span style="color: #3387cc;">0x28</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>,
<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>
};
<span style="color: #dad085;">int</span> main(<span style="color: #dad085;">void</span>){
unsigned short count <span style="color: #e28964;">=</span> <span style="color: #3387cc;">0</span>;
PLL_Init(); <span style="color: #aeaeae; font-style: italic;">// set system clock to 50 MHz</span>
Nokia5110_Init();
<span style="color: #e28964;">for</span>(count<span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>; count<<span style="color: #3387cc;">5</span>; count<span style="color: #e28964;">=</span>count<span style="color: #e28964;">+</span><span style="color: #3387cc;">1</span>){
Nokia5110_DrawFullImage(Longhorn);
Delay(<span style="color: #3387cc;">16666667</span>); <span style="color: #aeaeae; font-style: italic;">// delay ~1 sec at 50 MHz</span>
Nokia5110_DrawFullImage(Longhorn2);
Delay(<span style="color: #3387cc;">16666667</span>); <span style="color: #aeaeae; font-style: italic;">// delay ~1 sec at 50 MHz</span>
}
count <span style="color: #e28964;">=</span> <span style="color: #3387cc;">0</span>;
Nokia5110_Clear();
Nokia5110_OutString(<span style="color: #65b042;">"************* LCD Test *************Letter: Num:------- ---- "</span>);
Nokia5110_OutChar(<span style="color: #3387cc;">127</span>); <span style="color: #aeaeae; font-style: italic;">// print UT sign</span>
<span style="color: #e28964;">while</span>(<span style="color: #3387cc;">1</span>){
Nokia5110_SetCursor(<span style="color: #3387cc;">5</span>, <span style="color: #3387cc;">5</span>); <span style="color: #aeaeae; font-style: italic;">// five leading spaces, bottom row</span>
Nokia5110_OutChar((count<span style="color: #e28964;">%</span><span style="color: #3387cc;">26</span>)<span style="color: #e28964;">+</span><span style="color: #65b042;">'A'</span>);
Nokia5110_OutChar(<span style="color: #65b042;">' '</span>);
Nokia5110_OutUDec(count);
Delay(<span style="color: #3387cc;">8333333</span>); <span style="color: #aeaeae; font-style: italic;">// delay ~0.5 sec at 50 MHz</span>
count <span style="color: #e28964;">=</span> count <span style="color: #e28964;">+</span> <span style="color: #3387cc;">1</span>;
}
}
</pre>
<br />
PLL.h - для таймера.
<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">// PLL.h</span>
<span style="color: #aeaeae; font-style: italic;">// Runs on LM4F120/TM4C123</span>
<span style="color: #aeaeae; font-style: italic;">// A software function to change the bus frequency using the PLL.</span>
<span style="color: #aeaeae; font-style: italic;">// Daniel Valvano</span>
<span style="color: #aeaeae; font-style: italic;">// September 10, 2013</span>
<span style="color: #aeaeae; font-style: italic;">/* This example accompanies the book
"Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2013
Program 2.10, Figure 2.37
Copyright 2013 by Jonathan W. Valvano, valvano@mail.utexas.edu
You may use, edit, run or distribute this file
as long as the above copyright notice remains
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
For more information about my classes, my research, and my books, see
http://users.ece.utexas.edu/~valvano/
*/</span>
<span style="color: #aeaeae; font-style: italic;">// The #define statement SYSDIV2 initializes</span>
<span style="color: #aeaeae; font-style: italic;">// the PLL to the desired frequency.</span>
#define SYSDIV2 <span style="color: #3387cc;">7</span>
<span style="color: #aeaeae; font-style: italic;">// bus frequency is 400MHz/(SYSDIV2+1) = 400MHz/(7+1) = 50 MHz</span>
<span style="color: #aeaeae; font-style: italic;">// configure the system to get its clock from the PLL</span>
<span style="color: #dad085;">void</span> PLL_Init(<span style="color: #dad085;">void</span>);
<span style="color: #aeaeae; font-style: italic;">/*
SYSDIV2 Divisor Clock (MHz)
0 1 reserved
1 2 reserved
2 3 reserved
3 4 reserved
4 5 80.000
5 6 66.667
6 7 reserved
7 8 50.000
8 9 44.444
9 10 40.000
10 11 36.364
11 12 33.333
12 13 30.769
13 14 28.571
14 15 26.667
15 16 25.000
16 17 23.529
17 18 22.222
18 19 21.053
19 20 20.000
20 21 19.048
21 22 18.182
22 23 17.391
23 24 16.667
24 25 16.000
25 26 15.385
26 27 14.815
27 28 14.286
28 29 13.793
29 30 13.333
30 31 12.903
31 32 12.500
32 33 12.121
33 34 11.765
34 35 11.429
35 36 11.111
36 37 10.811
37 38 10.526
38 39 10.256
39 40 10.000
40 41 9.756
41 42 9.524
42 43 9.302
43 44 9.091
44 45 8.889
45 46 8.696
46 47 8.511
47 48 8.333
48 49 8.163
49 50 8.000
50 51 7.843
51 52 7.692
52 53 7.547
53 54 7.407
54 55 7.273
55 56 7.143
56 57 7.018
57 58 6.897
58 59 6.780
59 60 6.667
60 61 6.557
61 62 6.452
62 63 6.349
63 64 6.250
64 65 6.154
65 66 6.061
66 67 5.970
67 68 5.882
68 69 5.797
69 70 5.714
70 71 5.634
71 72 5.556
72 73 5.479
73 74 5.405
74 75 5.333
75 76 5.263
76 77 5.195
77 78 5.128
78 79 5.063
79 80 5.000
80 81 4.938
81 82 4.878
82 83 4.819
83 84 4.762
84 85 4.706
85 86 4.651
86 87 4.598
87 88 4.545
88 89 4.494
89 90 4.444
90 91 4.396
91 92 4.348
92 93 4.301
93 94 4.255
94 95 4.211
95 96 4.167
96 97 4.124
97 98 4.082
98 99 4.040
99 100 4.000
100 101 3.960
101 102 3.922
102 103 3.883
103 104 3.846
104 105 3.810
105 106 3.774
106 107 3.738
107 108 3.704
108 109 3.670
109 110 3.636
110 111 3.604
111 112 3.571
112 113 3.540
113 114 3.509
114 115 3.478
115 116 3.448
116 117 3.419
117 118 3.390
118 119 3.361
119 120 3.333
120 121 3.306
121 122 3.279
122 123 3.252
123 124 3.226
124 125 3.200
125 126 3.175
126 127 3.150
127 128 3.125
*/</span>
</pre>
<br />
PLL.c<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">// PLL.c</span>
<span style="color: #aeaeae; font-style: italic;">// Runs on LM4F120/TM4C123</span>
<span style="color: #aeaeae; font-style: italic;">// A software function to change the bus frequency using the PLL.</span>
<span style="color: #aeaeae; font-style: italic;">// Daniel Valvano</span>
<span style="color: #aeaeae; font-style: italic;">// September 10, 2013</span>
<span style="color: #aeaeae; font-style: italic;">/* This example accompanies the book
"Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2013
Program 2.10, Figure 2.37
Copyright 2013 by Jonathan W. Valvano, valvano@mail.utexas.edu
You may use, edit, run or distribute this file
as long as the above copyright notice remains
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
For more information about my classes, my research, and my books, see
http://users.ece.utexas.edu/~valvano/
*/</span>
#include <span style="color: #65b042;">"PLL.h"</span>
<span style="color: #aeaeae; font-style: italic;">// The #define statement SYSDIV2 in PLL.h</span>
<span style="color: #aeaeae; font-style: italic;">// initializes the PLL to the desired frequency.</span>
<span style="color: #aeaeae; font-style: italic;">// bus frequency is 400MHz/(SYSDIV2+1) = 400MHz/(7+1) = 50 MHz</span>
<span style="color: #aeaeae; font-style: italic;">// see the table at the end of this file</span>
#define SYSCTL_RIS_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x400FE050</span>))
#define SYSCTL_RIS_PLLLRIS <span style="color: #3387cc;">0x00000040</span> <span style="color: #aeaeae; font-style: italic;">// PLL Lock Raw Interrupt Status</span>
#define SYSCTL_RCC_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x400FE060</span>))
#define SYSCTL_RCC_XTAL_M <span style="color: #3387cc;">0x000007C0</span> <span style="color: #aeaeae; font-style: italic;">// Crystal Value</span>
#define SYSCTL_RCC_XTAL_6MHZ <span style="color: #3387cc;">0x000002C0</span> <span style="color: #aeaeae; font-style: italic;">// 6 MHz Crystal</span>
#define SYSCTL_RCC_XTAL_8MHZ <span style="color: #3387cc;">0x00000380</span> <span style="color: #aeaeae; font-style: italic;">// 8 MHz Crystal</span>
#define SYSCTL_RCC_XTAL_16MHZ <span style="color: #3387cc;">0x00000540</span> <span style="color: #aeaeae; font-style: italic;">// 16 MHz Crystal</span>
#define SYSCTL_RCC2_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x400FE070</span>))
#define SYSCTL_RCC2_USERCC2 <span style="color: #3387cc;">0x80000000</span> <span style="color: #aeaeae; font-style: italic;">// Use RCC2</span>
#define SYSCTL_RCC2_DIV400 <span style="color: #3387cc;">0x40000000</span> <span style="color: #aeaeae; font-style: italic;">// Divide PLL as 400 MHz vs. 200</span>
<span style="color: #aeaeae; font-style: italic;">// MHz</span>
#define SYSCTL_RCC2_SYSDIV2_M <span style="color: #3387cc;">0x1F800000</span> <span style="color: #aeaeae; font-style: italic;">// System Clock Divisor 2</span>
#define SYSCTL_RCC2_SYSDIV2LSB <span style="color: #3387cc;">0x00400000</span> <span style="color: #aeaeae; font-style: italic;">// Additional LSB for SYSDIV2</span>
#define SYSCTL_RCC2_PWRDN2 <span style="color: #3387cc;">0x00002000</span> <span style="color: #aeaeae; font-style: italic;">// Power-Down PLL 2</span>
#define SYSCTL_RCC2_BYPASS2 <span style="color: #3387cc;">0x00000800</span> <span style="color: #aeaeae; font-style: italic;">// PLL Bypass 2</span>
#define SYSCTL_RCC2_OSCSRC2_M <span style="color: #3387cc;">0x00000070</span> <span style="color: #aeaeae; font-style: italic;">// Oscillator Source 2</span>
#define SYSCTL_RCC2_OSCSRC2_MO <span style="color: #3387cc;">0x00000000</span> <span style="color: #aeaeae; font-style: italic;">// MOSC</span>
<span style="color: #aeaeae; font-style: italic;">// configure the system to get its clock from the PLL</span>
<span style="color: #dad085;">void</span> PLL_Init(<span style="color: #dad085;">void</span>){
<span style="color: #aeaeae; font-style: italic;">// 0) configure the system to use RCC2 for advanced features</span>
<span style="color: #aeaeae; font-style: italic;">// such as 400 MHz PLL and non-integer System Clock Divisor</span>
SYSCTL_RCC2_R |<span style="color: #e28964;">=</span> SYSCTL_RCC2_USERCC2;
<span style="color: #aeaeae; font-style: italic;">// 1) bypass PLL while initializing</span>
SYSCTL_RCC2_R |<span style="color: #e28964;">=</span> SYSCTL_RCC2_BYPASS2;
<span style="color: #aeaeae; font-style: italic;">// 2) select the crystal value and oscillator source</span>
SYSCTL_RCC_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~SYSCTL_RCC_XTAL_M; <span style="color: #aeaeae; font-style: italic;">// clear XTAL field</span>
SYSCTL_RCC_R <span style="color: #e28964;">+</span><span style="color: #e28964;">=</span> SYSCTL_RCC_XTAL_16MHZ;<span style="color: #aeaeae; font-style: italic;">// configure for 16 MHz crystal</span>
SYSCTL_RCC2_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~SYSCTL_RCC2_OSCSRC2_M;<span style="color: #aeaeae; font-style: italic;">// clear oscillator source field</span>
SYSCTL_RCC2_R <span style="color: #e28964;">+</span><span style="color: #e28964;">=</span> SYSCTL_RCC2_OSCSRC2_MO;<span style="color: #aeaeae; font-style: italic;">// configure for main oscillator source</span>
<span style="color: #aeaeae; font-style: italic;">// 3) activate PLL by clearing PWRDN</span>
SYSCTL_RCC2_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~SYSCTL_RCC2_PWRDN2;
<span style="color: #aeaeae; font-style: italic;">// 4) set the desired system divider and the system divider least significant bit</span>
SYSCTL_RCC2_R |<span style="color: #e28964;">=</span> SYSCTL_RCC2_DIV400; <span style="color: #aeaeae; font-style: italic;">// use 400 MHz PLL</span>
SYSCTL_RCC2_R <span style="color: #e28964;">=</span> (SYSCTL_RCC2_R<span style="color: #e28964;">&</span>~<span style="color: #3387cc;">0x1FC00000</span>) <span style="color: #aeaeae; font-style: italic;">// clear system clock divider field</span>
<span style="color: #e28964;">+</span> (SYSDIV2<<<span style="color: #3387cc;">22</span>); <span style="color: #aeaeae; font-style: italic;">// configure for 80 MHz clock</span>
<span style="color: #aeaeae; font-style: italic;">// 5) wait for the PLL to lock by polling PLLLRIS</span>
<span style="color: #e28964;">while</span>((SYSCTL_RIS_R<span style="color: #e28964;">&</span>SYSCTL_RIS_PLLLRIS)<span style="color: #e28964;">=</span><span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>){};
<span style="color: #aeaeae; font-style: italic;">// 6) enable use of PLL by clearing BYPASS</span>
SYSCTL_RCC2_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~SYSCTL_RCC2_BYPASS2;
}
<span style="color: #aeaeae; font-style: italic;">/*
SYSDIV2 Divisor Clock (MHz)
0 1 reserved
1 2 reserved
2 3 reserved
3 4 reserved
4 5 80.000
5 6 66.667
6 7 reserved
7 8 50.000
8 9 44.444
9 10 40.000
10 11 36.364
11 12 33.333
12 13 30.769
13 14 28.571
14 15 26.667
15 16 25.000
16 17 23.529
17 18 22.222
18 19 21.053
19 20 20.000
20 21 19.048
21 22 18.182
22 23 17.391
23 24 16.667
24 25 16.000
25 26 15.385
26 27 14.815
27 28 14.286
28 29 13.793
29 30 13.333
30 31 12.903
31 32 12.500
32 33 12.121
33 34 11.765
34 35 11.429
35 36 11.111
36 37 10.811
37 38 10.526
38 39 10.256
39 40 10.000
40 41 9.756
41 42 9.524
42 43 9.302
43 44 9.091
44 45 8.889
45 46 8.696
46 47 8.511
47 48 8.333
48 49 8.163
49 50 8.000
50 51 7.843
51 52 7.692
52 53 7.547
53 54 7.407
54 55 7.273
55 56 7.143
56 57 7.018
57 58 6.897
58 59 6.780
59 60 6.667
60 61 6.557
61 62 6.452
62 63 6.349
63 64 6.250
64 65 6.154
65 66 6.061
66 67 5.970
67 68 5.882
68 69 5.797
69 70 5.714
70 71 5.634
71 72 5.556
72 73 5.479
73 74 5.405
74 75 5.333
75 76 5.263
76 77 5.195
77 78 5.128
78 79 5.063
79 80 5.000
80 81 4.938
81 82 4.878
82 83 4.819
83 84 4.762
84 85 4.706
85 86 4.651
86 87 4.598
87 88 4.545
88 89 4.494
89 90 4.444
90 91 4.396
91 92 4.348
92 93 4.301
93 94 4.255
94 95 4.211
95 96 4.167
96 97 4.124
97 98 4.082
98 99 4.040
99 100 4.000
100 101 3.960
101 102 3.922
102 103 3.883
103 104 3.846
104 105 3.810
105 106 3.774
106 107 3.738
107 108 3.704
108 109 3.670
109 110 3.636
110 111 3.604
111 112 3.571
112 113 3.540
113 114 3.509
114 115 3.478
115 116 3.448
116 117 3.419
117 118 3.390
118 119 3.361
119 120 3.333
120 121 3.306
121 122 3.279
122 123 3.252
123 124 3.226
124 125 3.200
125 126 3.175
126 127 3.150
127 128 3.125
*/</span>
</pre>
<br />
А вот и библиотека для работы с дисплеем, Nokia5110.h<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">// Nokia5110.h</span>
<span style="color: #aeaeae; font-style: italic;">// Runs on LM4F120/TM4C123</span>
<span style="color: #aeaeae; font-style: italic;">// Use SSI0 to send an 8-bit code to the Nokia5110 48x84</span>
<span style="color: #aeaeae; font-style: italic;">// pixel LCD to display text, images, or other information.</span>
<span style="color: #aeaeae; font-style: italic;">// Daniel Valvano</span>
<span style="color: #aeaeae; font-style: italic;">// September 16, 2013</span>
<span style="color: #aeaeae; font-style: italic;">// Font table, initialization, and other functions based</span>
<span style="color: #aeaeae; font-style: italic;">// off of Nokia_5110_Example from Spark Fun:</span>
<span style="color: #aeaeae; font-style: italic;">// 7-17-2011</span>
<span style="color: #aeaeae; font-style: italic;">// Spark Fun Electronics 2011</span>
<span style="color: #aeaeae; font-style: italic;">// Nathan Seidle</span>
<span style="color: #aeaeae; font-style: italic;">// http://dlnmh9ip6v2uc.cloudfront.net/datasheets/LCD/Monochrome/Nokia_5110_Example.pde</span>
<span style="color: #aeaeae; font-style: italic;">/* This example accompanies the book
"Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2013
Copyright 2013 by Jonathan W. Valvano, valvano@mail.utexas.edu
You may use, edit, run or distribute this file
as long as the above copyright notice remains
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
For more information about my classes, my research, and my books, see
http://users.ece.utexas.edu/~valvano/
*/</span>
<span style="color: #aeaeae; font-style: italic;">// Blue Nokia 5110</span>
<span style="color: #aeaeae; font-style: italic;">// ---------------</span>
<span style="color: #aeaeae; font-style: italic;">// Signal (Nokia 5110) LaunchPad pin</span>
<span style="color: #aeaeae; font-style: italic;">// Reset (RST, pin 1) connected to PA7</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Fss (CE, pin 2) connected to PA3</span>
<span style="color: #aeaeae; font-style: italic;">// Data/Command (DC, pin 3) connected to PA6</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Tx (Din, pin 4) connected to PA5</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Clk (Clk, pin 5) connected to PA2</span>
<span style="color: #aeaeae; font-style: italic;">// 3.3V (Vcc, pin 6) power</span>
<span style="color: #aeaeae; font-style: italic;">// back light (BL, pin 7) not connected</span>
<span style="color: #aeaeae; font-style: italic;">// Ground (Gnd, pin 8) ground</span>
<span style="color: #aeaeae; font-style: italic;">// Red SparkFun Nokia 5110 (LCD-10168)</span>
<span style="color: #aeaeae; font-style: italic;">// -----------------------------------</span>
<span style="color: #aeaeae; font-style: italic;">// Signal (Nokia 5110) LaunchPad pin</span>
<span style="color: #aeaeae; font-style: italic;">// 3.3V (VCC, pin 1) power</span>
<span style="color: #aeaeae; font-style: italic;">// Ground (GND, pin 2) ground</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Fss (SCE, pin 3) connected to PA3</span>
<span style="color: #aeaeae; font-style: italic;">// Reset (RST, pin 4) connected to PA7</span>
<span style="color: #aeaeae; font-style: italic;">// Data/Command (D/C, pin 5) connected to PA6</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Tx (DN, pin 6) connected to PA5</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Clk (SCLK, pin 7) connected to PA2</span>
<span style="color: #aeaeae; font-style: italic;">// back light (LED, pin 8) not connected</span>
<span style="color: #aeaeae; font-style: italic;">// Maximum dimensions of the LCD, although the pixels are</span>
<span style="color: #aeaeae; font-style: italic;">// numbered from zero to (MAX-1). Address may automatically</span>
<span style="color: #aeaeae; font-style: italic;">// be incremented after each transmission.</span>
#define MAX_X <span style="color: #3387cc;">84</span>
#define MAX_Y <span style="color: #3387cc;">48</span>
<span style="color: #aeaeae; font-style: italic;">// Contrast value 0xB1 looks good on red SparkFun</span>
<span style="color: #aeaeae; font-style: italic;">// and 0xB8 looks good on blue Nokia 5110.</span>
<span style="color: #aeaeae; font-style: italic;">// Adjust this from 0xA0 (lighter) to 0xCF (darker) for your display.</span>
#define CONTRAST <span style="color: #3387cc;">0xB1</span>
<span style="color: #aeaeae; font-style: italic;">// This table contains the hex values that represent pixels</span>
<span style="color: #aeaeae; font-style: italic;">// for a font that is 5 pixels wide and 8 pixels high</span>
<span style="color: #e28964;">static</span> const char ASCII[][<span style="color: #3387cc;">5</span>] <span style="color: #e28964;">=</span> {
{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 20</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x5f</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 21 !</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 22 "</span>
,{<span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x14</span>} <span style="color: #aeaeae; font-style: italic;">// 23 #</span>
,{<span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0x2a</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x2a</span>, <span style="color: #3387cc;">0x12</span>} <span style="color: #aeaeae; font-style: italic;">// 24 $</span>
,{<span style="color: #3387cc;">0x23</span>, <span style="color: #3387cc;">0x13</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x64</span>, <span style="color: #3387cc;">0x62</span>} <span style="color: #aeaeae; font-style: italic;">// 25 %</span>
,{<span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x55</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x50</span>} <span style="color: #aeaeae; font-style: italic;">// 26 &</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x05</span>, <span style="color: #3387cc;">0x03</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 27 '</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x1c</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 28 (</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x1c</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 29 )</span>
,{<span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x14</span>} <span style="color: #aeaeae; font-style: italic;">// 2a *</span>
,{<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>} <span style="color: #aeaeae; font-style: italic;">// 2b +</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x50</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 2c ,</span>
,{<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>} <span style="color: #aeaeae; font-style: italic;">// 2d -</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x60</span>, <span style="color: #3387cc;">0x60</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 2e .</span>
,{<span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x02</span>} <span style="color: #aeaeae; font-style: italic;">// 2f /</span>
,{<span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x51</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x45</span>, <span style="color: #3387cc;">0x3e</span>} <span style="color: #aeaeae; font-style: italic;">// 30 0</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x42</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 31 1</span>
,{<span style="color: #3387cc;">0x42</span>, <span style="color: #3387cc;">0x61</span>, <span style="color: #3387cc;">0x51</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x46</span>} <span style="color: #aeaeae; font-style: italic;">// 32 2</span>
,{<span style="color: #3387cc;">0x21</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x45</span>, <span style="color: #3387cc;">0x4b</span>, <span style="color: #3387cc;">0x31</span>} <span style="color: #aeaeae; font-style: italic;">// 33 3</span>
,{<span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x12</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x10</span>} <span style="color: #aeaeae; font-style: italic;">// 34 4</span>
,{<span style="color: #3387cc;">0x27</span>, <span style="color: #3387cc;">0x45</span>, <span style="color: #3387cc;">0x45</span>, <span style="color: #3387cc;">0x45</span>, <span style="color: #3387cc;">0x39</span>} <span style="color: #aeaeae; font-style: italic;">// 35 5</span>
,{<span style="color: #3387cc;">0x3c</span>, <span style="color: #3387cc;">0x4a</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x30</span>} <span style="color: #aeaeae; font-style: italic;">// 36 6</span>
,{<span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x71</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x05</span>, <span style="color: #3387cc;">0x03</span>} <span style="color: #aeaeae; font-style: italic;">// 37 7</span>
,{<span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x36</span>} <span style="color: #aeaeae; font-style: italic;">// 38 8</span>
,{<span style="color: #3387cc;">0x06</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x29</span>, <span style="color: #3387cc;">0x1e</span>} <span style="color: #aeaeae; font-style: italic;">// 39 9</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 3a :</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x56</span>, <span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 3b ;</span>
,{<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 3c <</span>
,{<span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>} <span style="color: #aeaeae; font-style: italic;">// 3d =</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x08</span>} <span style="color: #aeaeae; font-style: italic;">// 3e ></span>
,{<span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x51</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x06</span>} <span style="color: #aeaeae; font-style: italic;">// 3f ?</span>
,{<span style="color: #3387cc;">0x32</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x79</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x3e</span>} <span style="color: #aeaeae; font-style: italic;">// 40 @</span>
,{<span style="color: #3387cc;">0x7e</span>, <span style="color: #3387cc;">0x11</span>, <span style="color: #3387cc;">0x11</span>, <span style="color: #3387cc;">0x11</span>, <span style="color: #3387cc;">0x7e</span>} <span style="color: #aeaeae; font-style: italic;">// 41 A</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x36</span>} <span style="color: #aeaeae; font-style: italic;">// 42 B</span>
,{<span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x22</span>} <span style="color: #aeaeae; font-style: italic;">// 43 C</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x1c</span>} <span style="color: #aeaeae; font-style: italic;">// 44 D</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x41</span>} <span style="color: #aeaeae; font-style: italic;">// 45 E</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x01</span>} <span style="color: #aeaeae; font-style: italic;">// 46 F</span>
,{<span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x7a</span>} <span style="color: #aeaeae; font-style: italic;">// 47 G</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x7f</span>} <span style="color: #aeaeae; font-style: italic;">// 48 H</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 49 I</span>
,{<span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x3f</span>, <span style="color: #3387cc;">0x01</span>} <span style="color: #aeaeae; font-style: italic;">// 4a J</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x22</span>, <span style="color: #3387cc;">0x41</span>} <span style="color: #aeaeae; font-style: italic;">// 4b K</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>} <span style="color: #aeaeae; font-style: italic;">// 4c L</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x0c</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x7f</span>} <span style="color: #aeaeae; font-style: italic;">// 4d M</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x7f</span>} <span style="color: #aeaeae; font-style: italic;">// 4e N</span>
,{<span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x3e</span>} <span style="color: #aeaeae; font-style: italic;">// 4f O</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x06</span>} <span style="color: #aeaeae; font-style: italic;">// 50 P</span>
,{<span style="color: #3387cc;">0x3e</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x51</span>, <span style="color: #3387cc;">0x21</span>, <span style="color: #3387cc;">0x5e</span>} <span style="color: #aeaeae; font-style: italic;">// 51 Q</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x19</span>, <span style="color: #3387cc;">0x29</span>, <span style="color: #3387cc;">0x46</span>} <span style="color: #aeaeae; font-style: italic;">// 52 R</span>
,{<span style="color: #3387cc;">0x46</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x31</span>} <span style="color: #aeaeae; font-style: italic;">// 53 S</span>
,{<span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x01</span>} <span style="color: #aeaeae; font-style: italic;">// 54 T</span>
,{<span style="color: #3387cc;">0x3f</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x3f</span>} <span style="color: #aeaeae; font-style: italic;">// 55 U</span>
,{<span style="color: #3387cc;">0x1f</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x1f</span>} <span style="color: #aeaeae; font-style: italic;">// 56 V</span>
,{<span style="color: #3387cc;">0x3f</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x3f</span>} <span style="color: #aeaeae; font-style: italic;">// 57 W</span>
,{<span style="color: #3387cc;">0x63</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x63</span>} <span style="color: #aeaeae; font-style: italic;">// 58 X</span>
,{<span style="color: #3387cc;">0x07</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x70</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x07</span>} <span style="color: #aeaeae; font-style: italic;">// 59 Y</span>
,{<span style="color: #3387cc;">0x61</span>, <span style="color: #3387cc;">0x51</span>, <span style="color: #3387cc;">0x49</span>, <span style="color: #3387cc;">0x45</span>, <span style="color: #3387cc;">0x43</span>} <span style="color: #aeaeae; font-style: italic;">// 5a Z</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 5b [</span>
,{<span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x20</span>} <span style="color: #aeaeae; font-style: italic;">// 5c '\'</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 5d ]</span>
,{<span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x04</span>} <span style="color: #aeaeae; font-style: italic;">// 5e ^</span>
,{<span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>} <span style="color: #aeaeae; font-style: italic;">// 5f _</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x02</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 60 `</span>
,{<span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x78</span>} <span style="color: #aeaeae; font-style: italic;">// 61 a</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x48</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x38</span>} <span style="color: #aeaeae; font-style: italic;">// 62 b</span>
,{<span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x20</span>} <span style="color: #aeaeae; font-style: italic;">// 63 c</span>
,{<span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x48</span>, <span style="color: #3387cc;">0x7f</span>} <span style="color: #aeaeae; font-style: italic;">// 64 d</span>
,{<span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x18</span>} <span style="color: #aeaeae; font-style: italic;">// 65 e</span>
,{<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x7e</span>, <span style="color: #3387cc;">0x09</span>, <span style="color: #3387cc;">0x01</span>, <span style="color: #3387cc;">0x02</span>} <span style="color: #aeaeae; font-style: italic;">// 66 f</span>
,{<span style="color: #3387cc;">0x0c</span>, <span style="color: #3387cc;">0x52</span>, <span style="color: #3387cc;">0x52</span>, <span style="color: #3387cc;">0x52</span>, <span style="color: #3387cc;">0x3e</span>} <span style="color: #aeaeae; font-style: italic;">// 67 g</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x78</span>} <span style="color: #aeaeae; font-style: italic;">// 68 h</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x7d</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 69 i</span>
,{<span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x3d</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 6a j</span>
,{<span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x28</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 6b k</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 6c l</span>
,{<span style="color: #3387cc;">0x7c</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x78</span>} <span style="color: #aeaeae; font-style: italic;">// 6d m</span>
,{<span style="color: #3387cc;">0x7c</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x78</span>} <span style="color: #aeaeae; font-style: italic;">// 6e n</span>
,{<span style="color: #3387cc;">0x38</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x38</span>} <span style="color: #aeaeae; font-style: italic;">// 6f o</span>
,{<span style="color: #3387cc;">0x7c</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x08</span>} <span style="color: #aeaeae; font-style: italic;">// 70 p</span>
,{<span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x14</span>, <span style="color: #3387cc;">0x18</span>, <span style="color: #3387cc;">0x7c</span>} <span style="color: #aeaeae; font-style: italic;">// 71 q</span>
,{<span style="color: #3387cc;">0x7c</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x08</span>} <span style="color: #aeaeae; font-style: italic;">// 72 r</span>
,{<span style="color: #3387cc;">0x48</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x20</span>} <span style="color: #aeaeae; font-style: italic;">// 73 s</span>
,{<span style="color: #3387cc;">0x04</span>, <span style="color: #3387cc;">0x3f</span>, <span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x20</span>} <span style="color: #aeaeae; font-style: italic;">// 74 t</span>
,{<span style="color: #3387cc;">0x3c</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x7c</span>} <span style="color: #aeaeae; font-style: italic;">// 75 u</span>
,{<span style="color: #3387cc;">0x1c</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x20</span>, <span style="color: #3387cc;">0x1c</span>} <span style="color: #aeaeae; font-style: italic;">// 76 v</span>
,{<span style="color: #3387cc;">0x3c</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x30</span>, <span style="color: #3387cc;">0x40</span>, <span style="color: #3387cc;">0x3c</span>} <span style="color: #aeaeae; font-style: italic;">// 77 w</span>
,{<span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x28</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x28</span>, <span style="color: #3387cc;">0x44</span>} <span style="color: #aeaeae; font-style: italic;">// 78 x</span>
,{<span style="color: #3387cc;">0x0c</span>, <span style="color: #3387cc;">0x50</span>, <span style="color: #3387cc;">0x50</span>, <span style="color: #3387cc;">0x50</span>, <span style="color: #3387cc;">0x3c</span>} <span style="color: #aeaeae; font-style: italic;">// 79 y</span>
,{<span style="color: #3387cc;">0x44</span>, <span style="color: #3387cc;">0x64</span>, <span style="color: #3387cc;">0x54</span>, <span style="color: #3387cc;">0x4c</span>, <span style="color: #3387cc;">0x44</span>} <span style="color: #aeaeae; font-style: italic;">// 7a z</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 7b {</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x7f</span>, <span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 7c |</span>
,{<span style="color: #3387cc;">0x00</span>, <span style="color: #3387cc;">0x41</span>, <span style="color: #3387cc;">0x36</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x00</span>} <span style="color: #aeaeae; font-style: italic;">// 7d }</span>
,{<span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x08</span>, <span style="color: #3387cc;">0x10</span>, <span style="color: #3387cc;">0x08</span>} <span style="color: #aeaeae; font-style: italic;">// 7e ~</span>
<span style="color: #aeaeae; font-style: italic;">// ,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f DEL</span>
,{<span style="color: #3387cc;">0x1f</span>, <span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0x7c</span>, <span style="color: #3387cc;">0x24</span>, <span style="color: #3387cc;">0x1f</span>} <span style="color: #aeaeae; font-style: italic;">// 7f UT sign</span>
};
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_Init*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Initialize Nokia 5110 48x84 LCD by sending the proper</span>
<span style="color: #aeaeae; font-style: italic;">// commands to the PCD8544 driver. One new feature of the</span>
<span style="color: #aeaeae; font-style: italic;">// LM4F120 is that its SSIs can get their baud clock from</span>
<span style="color: #aeaeae; font-style: italic;">// either the system clock or from the 16 MHz precision</span>
<span style="color: #aeaeae; font-style: italic;">// internal oscillator. If the system clock is faster than</span>
<span style="color: #aeaeae; font-style: italic;">// 50 MHz, the SSI baud clock will be faster than the 4 MHz</span>
<span style="color: #aeaeae; font-style: italic;">// maximum of the Nokia 5110.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: system clock rate of 50 MHz or less</span>
<span style="color: #dad085;">void</span> Nokia5110_Init(<span style="color: #dad085;">void</span>);
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_OutChar*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Print a character to the Nokia 5110 48x84 LCD. The</span>
<span style="color: #aeaeae; font-style: italic;">// character will be printed at the current cursor position,</span>
<span style="color: #aeaeae; font-style: italic;">// the cursor will automatically be updated, and it will</span>
<span style="color: #aeaeae; font-style: italic;">// wrap to the next row or back to the top if necessary.</span>
<span style="color: #aeaeae; font-style: italic;">// One blank column of pixels will be printed on either side</span>
<span style="color: #aeaeae; font-style: italic;">// of the character for readability. Since characters are 8</span>
<span style="color: #aeaeae; font-style: italic;">// pixels tall and 5 pixels wide, 12 characters fit per row,</span>
<span style="color: #aeaeae; font-style: italic;">// and there are six rows.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: data character to print</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_OutChar(unsigned char <span style="color: #dad085;">data</span>);
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_OutString*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Print a string of characters to the Nokia 5110 48x84 LCD.</span>
<span style="color: #aeaeae; font-style: italic;">// The string will automatically wrap, so padding spaces may</span>
<span style="color: #aeaeae; font-style: italic;">// be needed to make the output look optimal.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: ptr pointer to NULL-terminated ASCII string</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_OutString(char <span style="color: #e28964;">*</span>ptr);
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_OutUDec*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Output a 16-bit number in unsigned decimal format with a</span>
<span style="color: #aeaeae; font-style: italic;">// fixed size of five right-justified digits of output.</span>
<span style="color: #aeaeae; font-style: italic;">// Inputs: n 16-bit unsigned number</span>
<span style="color: #aeaeae; font-style: italic;">// Outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_OutUDec(unsigned short n);
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_SetCursor*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Move the cursor to the desired X- and Y-position. The</span>
<span style="color: #aeaeae; font-style: italic;">// next character will be printed here. X=0 is the leftmost</span>
<span style="color: #aeaeae; font-style: italic;">// column. Y=0 is the top row.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: newX new X-position of the cursor (0<=newX<=11)</span>
<span style="color: #aeaeae; font-style: italic;">// newY new Y-position of the cursor (0<=newY<=5)</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #dad085;">void</span> Nokia5110_SetCursor(unsigned char newX, unsigned char newY);
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_Clear*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Clear the LCD by writing zeros to the entire screen and</span>
<span style="color: #aeaeae; font-style: italic;">// reset the cursor to (0,0) (top left corner of screen).</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #dad085;">void</span> Nokia5110_Clear(<span style="color: #dad085;">void</span>);
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_DrawFullImage*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Fill the whole screen by drawing a 48x84 bitmap image.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: ptr pointer to 504 byte bitmap</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_DrawFullImage(const char <span style="color: #e28964;">*</span>ptr);
</pre>
<br />
И, самое главное, Nokia5110.c<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">// Nokia5110.c</span>
<span style="color: #aeaeae; font-style: italic;">// Runs on LM4F120/TM4C123</span>
<span style="color: #aeaeae; font-style: italic;">// Use SSI0 to send an 8-bit code to the Nokia5110 48x84</span>
<span style="color: #aeaeae; font-style: italic;">// pixel LCD to display text, images, or other information.</span>
<span style="color: #aeaeae; font-style: italic;">// Daniel Valvano</span>
<span style="color: #aeaeae; font-style: italic;">// September 16, 2013</span>
<span style="color: #aeaeae; font-style: italic;">// Font table, initialization, and other functions based</span>
<span style="color: #aeaeae; font-style: italic;">// off of Nokia_5110_Example from Spark Fun:</span>
<span style="color: #aeaeae; font-style: italic;">// 7-17-2011</span>
<span style="color: #aeaeae; font-style: italic;">// Spark Fun Electronics 2011</span>
<span style="color: #aeaeae; font-style: italic;">// Nathan Seidle</span>
<span style="color: #aeaeae; font-style: italic;">// http://dlnmh9ip6v2uc.cloudfront.net/datasheets/LCD/Monochrome/Nokia_5110_Example.pde</span>
<span style="color: #aeaeae; font-style: italic;">/* This example accompanies the book
"Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2013
Copyright 2013 by Jonathan W. Valvano, valvano@mail.utexas.edu
You may use, edit, run or distribute this file
as long as the above copyright notice remains
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
For more information about my classes, my research, and my books, see
http://users.ece.utexas.edu/~valvano/
*/</span>
<span style="color: #aeaeae; font-style: italic;">// Blue Nokia 5110</span>
<span style="color: #aeaeae; font-style: italic;">// ---------------</span>
<span style="color: #aeaeae; font-style: italic;">// Signal (Nokia 5110) LaunchPad pin</span>
<span style="color: #aeaeae; font-style: italic;">// Reset (RST, pin 1) connected to PA7</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Fss (CE, pin 2) connected to PA3</span>
<span style="color: #aeaeae; font-style: italic;">// Data/Command (DC, pin 3) connected to PA6</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Tx (Din, pin 4) connected to PA5</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Clk (Clk, pin 5) connected to PA2</span>
<span style="color: #aeaeae; font-style: italic;">// 3.3V (Vcc, pin 6) power</span>
<span style="color: #aeaeae; font-style: italic;">// back light (BL, pin 7) not connected, consists of 4 white LEDs which draw ~80mA total</span>
<span style="color: #aeaeae; font-style: italic;">// Ground (Gnd, pin 8) ground</span>
<span style="color: #aeaeae; font-style: italic;">// Red SparkFun Nokia 5110 (LCD-10168)</span>
<span style="color: #aeaeae; font-style: italic;">// -----------------------------------</span>
<span style="color: #aeaeae; font-style: italic;">// Signal (Nokia 5110) LaunchPad pin</span>
<span style="color: #aeaeae; font-style: italic;">// 3.3V (VCC, pin 1) power</span>
<span style="color: #aeaeae; font-style: italic;">// Ground (GND, pin 2) ground</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Fss (SCE, pin 3) connected to PA3</span>
<span style="color: #aeaeae; font-style: italic;">// Reset (RST, pin 4) connected to PA7</span>
<span style="color: #aeaeae; font-style: italic;">// Data/Command (D/C, pin 5) connected to PA6</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Tx (DN, pin 6) connected to PA5</span>
<span style="color: #aeaeae; font-style: italic;">// SSI0Clk (SCLK, pin 7) connected to PA2</span>
<span style="color: #aeaeae; font-style: italic;">// back light (LED, pin 8) not connected, consists of 4 white LEDs which draw ~80mA total</span>
#include <span style="color: #65b042;">"Nokia5110.h"</span>
#define DC (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40004100</span>))
#define DC_COMMAND <span style="color: #3387cc;">0</span>
#define DC_DATA <span style="color: #3387cc;">0x40</span>
#define RESET (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40004200</span>))
#define RESET_LOW <span style="color: #3387cc;">0</span>
#define RESET_HIGH <span style="color: #3387cc;">0x80</span>
#define GPIO_PORTA_DIR_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40004400</span>))
#define GPIO_PORTA_AFSEL_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40004420</span>))
#define GPIO_PORTA_DEN_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x4000451C</span>))
#define GPIO_PORTA_AMSEL_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40004528</span>))
#define GPIO_PORTA_PCTL_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x4000452C</span>))
#define SSI0_CR0_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40008000</span>))
#define SSI0_CR1_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40008004</span>))
#define SSI0_DR_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40008008</span>))
#define SSI0_SR_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x4000800C</span>))
#define SSI0_CPSR_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40008010</span>))
#define SSI0_CC_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x40008FC8</span>))
#define SSI_CR0_SCR_M <span style="color: #3387cc;">0x0000FF00</span> <span style="color: #aeaeae; font-style: italic;">// SSI Serial Clock Rate</span>
#define SSI_CR0_SPH <span style="color: #3387cc;">0x00000080</span> <span style="color: #aeaeae; font-style: italic;">// SSI Serial Clock Phase</span>
#define SSI_CR0_SPO <span style="color: #3387cc;">0x00000040</span> <span style="color: #aeaeae; font-style: italic;">// SSI Serial Clock Polarity</span>
#define SSI_CR0_FRF_M <span style="color: #3387cc;">0x00000030</span> <span style="color: #aeaeae; font-style: italic;">// SSI Frame Format Select</span>
#define SSI_CR0_FRF_MOTO <span style="color: #3387cc;">0x00000000</span> <span style="color: #aeaeae; font-style: italic;">// Freescale SPI Frame Format</span>
#define SSI_CR0_DSS_M <span style="color: #3387cc;">0x0000000F</span> <span style="color: #aeaeae; font-style: italic;">// SSI Data Size Select</span>
#define SSI_CR0_DSS_8 <span style="color: #3387cc;">0x00000007</span> <span style="color: #aeaeae; font-style: italic;">// 8-bit data</span>
#define SSI_CR1_MS <span style="color: #3387cc;">0x00000004</span> <span style="color: #aeaeae; font-style: italic;">// SSI Master/Slave Select</span>
#define SSI_CR1_SSE <span style="color: #3387cc;">0x00000002</span> <span style="color: #aeaeae; font-style: italic;">// SSI Synchronous Serial Port</span>
<span style="color: #aeaeae; font-style: italic;">// Enable</span>
#define SSI_SR_BSY <span style="color: #3387cc;">0x00000010</span> <span style="color: #aeaeae; font-style: italic;">// SSI Busy Bit</span>
#define SSI_SR_TNF <span style="color: #3387cc;">0x00000002</span> <span style="color: #aeaeae; font-style: italic;">// SSI Transmit FIFO Not Full</span>
#define SSI_CPSR_CPSDVSR_M <span style="color: #3387cc;">0x000000FF</span> <span style="color: #aeaeae; font-style: italic;">// SSI Clock Prescale Divisor</span>
#define SSI_CC_CS_M <span style="color: #3387cc;">0x0000000F</span> <span style="color: #aeaeae; font-style: italic;">// SSI Baud Clock Source</span>
#define SSI_CC_CS_SYSPLL <span style="color: #3387cc;">0x00000000</span> <span style="color: #aeaeae; font-style: italic;">// Either the system clock (if the</span>
<span style="color: #aeaeae; font-style: italic;">// PLL bypass is in effect) or the</span>
<span style="color: #aeaeae; font-style: italic;">// PLL output (default)</span>
#define SYSCTL_RCGC1_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x400FE104</span>))
#define SYSCTL_RCGC2_R (<span style="color: #e28964;">*</span>((volatile unsigned long <span style="color: #e28964;">*</span>)<span style="color: #3387cc;">0x400FE108</span>))
#define SYSCTL_RCGC1_SSI0 <span style="color: #3387cc;">0x00000010</span> <span style="color: #aeaeae; font-style: italic;">// SSI0 Clock Gating Control</span>
#define SYSCTL_RCGC2_GPIOA <span style="color: #3387cc;">0x00000001</span> <span style="color: #aeaeae; font-style: italic;">// port A Clock Gating Control</span>
enum typeOfWrite{
COMMAND, <span style="color: #aeaeae; font-style: italic;">// the transmission is an LCD command</span>
DATA <span style="color: #aeaeae; font-style: italic;">// the transmission is data</span>
};
<span style="color: #aeaeae; font-style: italic;">// The Data/Command pin must be valid when the eighth bit is</span>
<span style="color: #aeaeae; font-style: italic;">// sent. The SSI module has hardware input and output FIFOs</span>
<span style="color: #aeaeae; font-style: italic;">// that are 8 locations deep. Based on the observation that</span>
<span style="color: #aeaeae; font-style: italic;">// the LCD interface tends to send a few commands and then a</span>
<span style="color: #aeaeae; font-style: italic;">// lot of data, the FIFOs are not used when writing</span>
<span style="color: #aeaeae; font-style: italic;">// commands, and they are used when writing data. This</span>
<span style="color: #aeaeae; font-style: italic;">// ensures that the Data/Command pin status matches the byte</span>
<span style="color: #aeaeae; font-style: italic;">// that is actually being transmitted.</span>
<span style="color: #aeaeae; font-style: italic;">// The write command operation waits until all data has been</span>
<span style="color: #aeaeae; font-style: italic;">// sent, configures the Data/Command pin for commands, sends</span>
<span style="color: #aeaeae; font-style: italic;">// the command, and then waits for the transmission to</span>
<span style="color: #aeaeae; font-style: italic;">// finish.</span>
<span style="color: #aeaeae; font-style: italic;">// The write data operation waits until there is room in the</span>
<span style="color: #aeaeae; font-style: italic;">// transmit FIFO, configures the Data/Command pin for data,</span>
<span style="color: #aeaeae; font-style: italic;">// and then adds the data to the transmit FIFO.</span>
<span style="color: #aeaeae; font-style: italic;">// This is a helper function that sends an 8-bit message to the LCD.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: type COMMAND or DATA</span>
<span style="color: #aeaeae; font-style: italic;">// message 8-bit code to transmit</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: SSI0 and port A have already been initialized and enabled</span>
<span style="color: #dad085;">void</span> <span style="color: #e28964;">static</span> lcdwrite(enum typeOfWrite <span style="color: #dad085;">type</span>, char <span style="color: #dad085;">message</span>){
<span style="color: #e28964;">if</span>(<span style="color: #dad085;">type</span> <span style="color: #e28964;">=</span><span style="color: #e28964;">=</span> COMMAND){
<span style="color: #aeaeae; font-style: italic;">// wait until SSI0 not busy/transmit FIFO empty</span>
<span style="color: #e28964;">while</span>((SSI0_SR_R<span style="color: #e28964;">&</span>SSI_SR_BSY)<span style="color: #e28964;">=</span><span style="color: #e28964;">=</span>SSI_SR_BSY){};
DC <span style="color: #e28964;">=</span> DC_COMMAND;
SSI0_DR_R <span style="color: #e28964;">=</span> <span style="color: #dad085;">message</span>; <span style="color: #aeaeae; font-style: italic;">// command out</span>
<span style="color: #aeaeae; font-style: italic;">// wait until SSI0 not busy/transmit FIFO empty</span>
<span style="color: #e28964;">while</span>((SSI0_SR_R<span style="color: #e28964;">&</span>SSI_SR_BSY)<span style="color: #e28964;">=</span><span style="color: #e28964;">=</span>SSI_SR_BSY){};
} <span style="color: #e28964;">else</span>{
<span style="color: #e28964;">while</span>((SSI0_SR_R<span style="color: #e28964;">&</span>SSI_SR_TNF)<span style="color: #e28964;">=</span><span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>){}; <span style="color: #aeaeae; font-style: italic;">// wait until transmit FIFO not full</span>
DC <span style="color: #e28964;">=</span> DC_DATA;
SSI0_DR_R <span style="color: #e28964;">=</span> <span style="color: #dad085;">message</span>; <span style="color: #aeaeae; font-style: italic;">// data out</span>
}
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_Init*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Initialize Nokia 5110 48x84 LCD by sending the proper</span>
<span style="color: #aeaeae; font-style: italic;">// commands to the PCD8544 driver. One new feature of the</span>
<span style="color: #aeaeae; font-style: italic;">// LM4F120 is that its SSIs can get their baud clock from</span>
<span style="color: #aeaeae; font-style: italic;">// either the system clock or from the 16 MHz precision</span>
<span style="color: #aeaeae; font-style: italic;">// internal oscillator. If the system clock is faster than</span>
<span style="color: #aeaeae; font-style: italic;">// 50 MHz, the SSI baud clock will be faster than the 4 MHz</span>
<span style="color: #aeaeae; font-style: italic;">// maximum of the Nokia 5110.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: system clock rate of 50 MHz or less</span>
<span style="color: #dad085;">void</span> Nokia5110_Init(<span style="color: #dad085;">void</span>){
volatile unsigned long delay;
SYSCTL_RCGC1_R |<span style="color: #e28964;">=</span> SYSCTL_RCGC1_SSI0; <span style="color: #aeaeae; font-style: italic;">// activate SSI0</span>
SYSCTL_RCGC2_R |<span style="color: #e28964;">=</span> SYSCTL_RCGC2_GPIOA; <span style="color: #aeaeae; font-style: italic;">// activate port A</span>
delay <span style="color: #e28964;">=</span> SYSCTL_RCGC2_R; <span style="color: #aeaeae; font-style: italic;">// allow time to finish activating</span>
GPIO_PORTA_DIR_R |<span style="color: #e28964;">=</span> <span style="color: #3387cc;">0xC0</span>; <span style="color: #aeaeae; font-style: italic;">// make PA6,7 out</span>
GPIO_PORTA_AFSEL_R |<span style="color: #e28964;">=</span> <span style="color: #3387cc;">0x2C</span>; <span style="color: #aeaeae; font-style: italic;">// enable alt funct on PA2,3,5</span>
GPIO_PORTA_AFSEL_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~<span style="color: #3387cc;">0xC0</span>; <span style="color: #aeaeae; font-style: italic;">// disable alt funct on PA6,7</span>
GPIO_PORTA_DEN_R |<span style="color: #e28964;">=</span> <span style="color: #3387cc;">0xEC</span>; <span style="color: #aeaeae; font-style: italic;">// enable digital I/O on PA2,3,5,6,7</span>
<span style="color: #aeaeae; font-style: italic;">// configure PA2,3,5 as SSI</span>
GPIO_PORTA_PCTL_R <span style="color: #e28964;">=</span> (GPIO_PORTA_PCTL_R<span style="color: #e28964;">&</span><span style="color: #3387cc;">0xFF0F00FF</span>)<span style="color: #e28964;">+</span><span style="color: #3387cc;">0x00202200</span>;
<span style="color: #aeaeae; font-style: italic;">// configure PA6,7 as GPIO</span>
GPIO_PORTA_PCTL_R <span style="color: #e28964;">=</span> (GPIO_PORTA_PCTL_R<span style="color: #e28964;">&</span><span style="color: #3387cc;">0x00FFFFFF</span>)<span style="color: #e28964;">+</span><span style="color: #3387cc;">0x00000000</span>;
GPIO_PORTA_AMSEL_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~<span style="color: #3387cc;">0xEC</span>; <span style="color: #aeaeae; font-style: italic;">// disable analog functionality on PA2,3,5,6,7</span>
SSI0_CR1_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~SSI_CR1_SSE; <span style="color: #aeaeae; font-style: italic;">// disable SSI</span>
SSI0_CR1_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~SSI_CR1_MS; <span style="color: #aeaeae; font-style: italic;">// master mode</span>
<span style="color: #aeaeae; font-style: italic;">// configure for system clock/PLL baud clock source</span>
SSI0_CC_R <span style="color: #e28964;">=</span> (SSI0_CC_R<span style="color: #e28964;">&</span>~SSI_CC_CS_M)<span style="color: #e28964;">+</span>SSI_CC_CS_SYSPLL;
<span style="color: #aeaeae; font-style: italic;">// clock divider for 3.125 MHz SSIClk (50 MHz PIOSC/16)</span>
SSI0_CPSR_R <span style="color: #e28964;">=</span> (SSI0_CPSR_R<span style="color: #e28964;">&</span>~SSI_CPSR_CPSDVSR_M)<span style="color: #e28964;">+</span><span style="color: #3387cc;">16</span>;
SSI0_CR0_R <span style="color: #e28964;">&</span><span style="color: #e28964;">=</span> ~(SSI_CR0_SCR_M | <span style="color: #aeaeae; font-style: italic;">// SCR = 0 (3.125 Mbps data rate)</span>
SSI_CR0_SPH | <span style="color: #aeaeae; font-style: italic;">// SPH = 0</span>
SSI_CR0_SPO); <span style="color: #aeaeae; font-style: italic;">// SPO = 0</span>
<span style="color: #aeaeae; font-style: italic;">// FRF = Freescale format</span>
SSI0_CR0_R <span style="color: #e28964;">=</span> (SSI0_CR0_R<span style="color: #e28964;">&</span>~SSI_CR0_FRF_M)<span style="color: #e28964;">+</span>SSI_CR0_FRF_MOTO;
<span style="color: #aeaeae; font-style: italic;">// DSS = 8-bit data</span>
SSI0_CR0_R <span style="color: #e28964;">=</span> (SSI0_CR0_R<span style="color: #e28964;">&</span>~SSI_CR0_DSS_M)<span style="color: #e28964;">+</span>SSI_CR0_DSS_8;
SSI0_CR1_R |<span style="color: #e28964;">=</span> SSI_CR1_SSE; <span style="color: #aeaeae; font-style: italic;">// enable SSI</span>
RESET <span style="color: #e28964;">=</span> RESET_LOW; <span style="color: #aeaeae; font-style: italic;">// reset the LCD to a known state</span>
<span style="color: #e28964;">for</span>(delay<span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>; delay<<span style="color: #3387cc;">10</span>; delay<span style="color: #e28964;">=</span>delay<span style="color: #e28964;">+</span><span style="color: #3387cc;">1</span>);<span style="color: #aeaeae; font-style: italic;">// delay minimum 100 ns</span>
RESET <span style="color: #e28964;">=</span> RESET_HIGH; <span style="color: #aeaeae; font-style: italic;">// negative logic</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x21</span>); <span style="color: #aeaeae; font-style: italic;">// chip active; horizontal addressing mode (V = 0); use extended instruction set (H = 1)</span>
<span style="color: #aeaeae; font-style: italic;">// set LCD Vop (contrast), which may require some tweaking:</span>
lcdwrite(COMMAND, CONTRAST); <span style="color: #aeaeae; font-style: italic;">// try 0xB1 (for 3.3V red SparkFun), 0xB8 (for 3.3V blue SparkFun), 0xBF if your display is too dark, or 0x80 to 0xFF if experimenting</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x04</span>); <span style="color: #aeaeae; font-style: italic;">// set temp coefficient</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x14</span>); <span style="color: #aeaeae; font-style: italic;">// LCD bias mode 1:48: try 0x13 or 0x14</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x20</span>); <span style="color: #aeaeae; font-style: italic;">// we must send 0x20 before modifying the display control mode</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x0C</span>); <span style="color: #aeaeae; font-style: italic;">// set display control to normal mode: 0x0D for inverse</span>
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_OutChar*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Print a character to the Nokia 5110 48x84 LCD. The</span>
<span style="color: #aeaeae; font-style: italic;">// character will be printed at the current cursor position,</span>
<span style="color: #aeaeae; font-style: italic;">// the cursor will automatically be updated, and it will</span>
<span style="color: #aeaeae; font-style: italic;">// wrap to the next row or back to the top if necessary.</span>
<span style="color: #aeaeae; font-style: italic;">// One blank column of pixels will be printed on either side</span>
<span style="color: #aeaeae; font-style: italic;">// of the character for readability. Since characters are 8</span>
<span style="color: #aeaeae; font-style: italic;">// pixels tall and 5 pixels wide, 12 characters fit per row,</span>
<span style="color: #aeaeae; font-style: italic;">// and there are six rows.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: data character to print</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_OutChar(unsigned char <span style="color: #dad085;">data</span>){
<span style="color: #dad085;">int</span> i;
lcdwrite(DATA, <span style="color: #3387cc;">0x00</span>); <span style="color: #aeaeae; font-style: italic;">// blank vertical line padding</span>
<span style="color: #e28964;">for</span>(i<span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>; i<<span style="color: #3387cc;">5</span>; i<span style="color: #e28964;">=</span>i<span style="color: #e28964;">+</span><span style="color: #3387cc;">1</span>){
lcdwrite(DATA, ASCII[<span style="color: #dad085;">data</span> <span style="color: #e28964;">-</span> <span style="color: #3387cc;">0x20</span>][i]);
}
lcdwrite(DATA, <span style="color: #3387cc;">0x00</span>); <span style="color: #aeaeae; font-style: italic;">// blank vertical line padding</span>
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_OutString*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Print a string of characters to the Nokia 5110 48x84 LCD.</span>
<span style="color: #aeaeae; font-style: italic;">// The string will automatically wrap, so padding spaces may</span>
<span style="color: #aeaeae; font-style: italic;">// be needed to make the output look optimal.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: ptr pointer to NULL-terminated ASCII string</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_OutString(char <span style="color: #e28964;">*</span>ptr){
<span style="color: #e28964;">while</span>(<span style="color: #e28964;">*</span>ptr){
Nokia5110_OutChar((unsigned char)<span style="color: #e28964;">*</span>ptr);
ptr <span style="color: #e28964;">=</span> ptr <span style="color: #e28964;">+</span> <span style="color: #3387cc;">1</span>;
}
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_OutUDec*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Output a 16-bit number in unsigned decimal format with a</span>
<span style="color: #aeaeae; font-style: italic;">// fixed size of five right-justified digits of output.</span>
<span style="color: #aeaeae; font-style: italic;">// Inputs: n 16-bit unsigned number</span>
<span style="color: #aeaeae; font-style: italic;">// Outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_OutUDec(unsigned short n){
<span style="color: #e28964;">if</span>(n < <span style="color: #3387cc;">10</span>){
Nokia5110_OutString(<span style="color: #65b042;">" "</span>);
Nokia5110_OutChar(n<span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* n is between 0 and 9 */</span>
} <span style="color: #e28964;">else</span> <span style="color: #e28964;">if</span>(n<<span style="color: #3387cc;">100</span>){
Nokia5110_OutString(<span style="color: #65b042;">" "</span>);
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* tens digit */</span>
Nokia5110_OutChar(n<span style="color: #e28964;">%</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* ones digit */</span>
} <span style="color: #e28964;">else</span> <span style="color: #e28964;">if</span>(n<<span style="color: #3387cc;">1000</span>){
Nokia5110_OutString(<span style="color: #65b042;">" "</span>);
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">100</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* hundreds digit */</span>
n <span style="color: #e28964;">=</span> n<span style="color: #e28964;">%</span><span style="color: #3387cc;">100</span>;
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* tens digit */</span>
Nokia5110_OutChar(n<span style="color: #e28964;">%</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* ones digit */</span>
}
<span style="color: #e28964;">else</span> <span style="color: #e28964;">if</span>(n<<span style="color: #3387cc;">10000</span>){
Nokia5110_OutChar(<span style="color: #65b042;">' '</span>);
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">1000</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* thousands digit */</span>
n <span style="color: #e28964;">=</span> n<span style="color: #e28964;">%</span><span style="color: #3387cc;">1000</span>;
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">100</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* hundreds digit */</span>
n <span style="color: #e28964;">=</span> n<span style="color: #e28964;">%</span><span style="color: #3387cc;">100</span>;
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* tens digit */</span>
Nokia5110_OutChar(n<span style="color: #e28964;">%</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* ones digit */</span>
}
<span style="color: #e28964;">else</span> {
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">10000</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* ten-thousands digit */</span>
n <span style="color: #e28964;">=</span> n<span style="color: #e28964;">%</span><span style="color: #3387cc;">10000</span>;
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">1000</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* thousands digit */</span>
n <span style="color: #e28964;">=</span> n<span style="color: #e28964;">%</span><span style="color: #3387cc;">1000</span>;
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">100</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* hundreds digit */</span>
n <span style="color: #e28964;">=</span> n<span style="color: #e28964;">%</span><span style="color: #3387cc;">100</span>;
Nokia5110_OutChar(n<span style="color: #e28964;">/</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* tens digit */</span>
Nokia5110_OutChar(n<span style="color: #e28964;">%</span><span style="color: #3387cc;">10</span><span style="color: #e28964;">+</span><span style="color: #65b042;">'0'</span>); <span style="color: #aeaeae; font-style: italic;">/* ones digit */</span>
}
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_SetCursor*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Move the cursor to the desired X- and Y-position. The</span>
<span style="color: #aeaeae; font-style: italic;">// next character will be printed here. X=0 is the leftmost</span>
<span style="color: #aeaeae; font-style: italic;">// column. Y=0 is the top row.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: newX new X-position of the cursor (0<=newX<=11)</span>
<span style="color: #aeaeae; font-style: italic;">// newY new Y-position of the cursor (0<=newY<=5)</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #dad085;">void</span> Nokia5110_SetCursor(unsigned char newX, unsigned char newY){
<span style="color: #e28964;">if</span>((newX > <span style="color: #3387cc;">11</span>) || (newY > <span style="color: #3387cc;">5</span>)){ <span style="color: #aeaeae; font-style: italic;">// bad input</span>
<span style="color: #e28964;">return</span>; <span style="color: #aeaeae; font-style: italic;">// do nothing</span>
}
<span style="color: #aeaeae; font-style: italic;">// multiply newX by 7 because each character is 7 columns wide</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x80</span>|(newX<span style="color: #e28964;">*</span><span style="color: #3387cc;">7</span>)); <span style="color: #aeaeae; font-style: italic;">// setting bit 7 updates X-position</span>
lcdwrite(COMMAND, <span style="color: #3387cc;">0x40</span>|newY); <span style="color: #aeaeae; font-style: italic;">// setting bit 6 updates Y-position</span>
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_Clear*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Clear the LCD by writing zeros to the entire screen and</span>
<span style="color: #aeaeae; font-style: italic;">// reset the cursor to (0,0) (top left corner of screen).</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #dad085;">void</span> Nokia5110_Clear(<span style="color: #dad085;">void</span>){
<span style="color: #dad085;">int</span> i;
<span style="color: #e28964;">for</span>(i<span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>; i<(MAX_X<span style="color: #e28964;">*</span>MAX_Y<span style="color: #e28964;">/</span><span style="color: #3387cc;">8</span>); i<span style="color: #e28964;">=</span>i<span style="color: #e28964;">+</span><span style="color: #3387cc;">1</span>){
lcdwrite(DATA, <span style="color: #3387cc;">0x00</span>);
}
Nokia5110_SetCursor(<span style="color: #3387cc;">0</span>, <span style="color: #3387cc;">0</span>);
}
<span style="color: #aeaeae; font-style: italic;">//********Nokia5110_DrawFullImage*****************</span>
<span style="color: #aeaeae; font-style: italic;">// Fill the whole screen by drawing a 48x84 bitmap image.</span>
<span style="color: #aeaeae; font-style: italic;">// inputs: ptr pointer to 504 byte bitmap</span>
<span style="color: #aeaeae; font-style: italic;">// outputs: none</span>
<span style="color: #aeaeae; font-style: italic;">// assumes: LCD is in default horizontal addressing mode (V = 0)</span>
<span style="color: #dad085;">void</span> Nokia5110_DrawFullImage(const char <span style="color: #e28964;">*</span>ptr){
<span style="color: #dad085;">int</span> i;
Nokia5110_SetCursor(<span style="color: #3387cc;">0</span>, <span style="color: #3387cc;">0</span>);
<span style="color: #e28964;">for</span>(i<span style="color: #e28964;">=</span><span style="color: #3387cc;">0</span>; i<(MAX_X<span style="color: #e28964;">*</span>MAX_Y<span style="color: #e28964;">/</span><span style="color: #3387cc;">8</span>); i<span style="color: #e28964;">=</span>i<span style="color: #e28964;">+</span><span style="color: #3387cc;">1</span>){
lcdwrite(DATA, ptr[i]);
}
}
</pre>
<br />
<b>UPD: </b><br />
Схема подключения.<br />
<table>
<tbody>
<tr><th>Контроллер</th><th>Дисплей</th></tr>
<tr><td>PA2</td><td>Clk</td></tr>
<tr><td>PA3</td><td>CE</td></tr>
<tr><td>PA5</td><td>Din</td></tr>
<tr><td>PA6</td><td>DC</td></tr>
<tr><td>PA7</td><td>RST</td></tr>
<tr><td>Gnd</td><td>Gnd</td></tr>
<tr><td>3.3 V</td><td>Vcc через резистор</td></tr>
<tr><td>3.3 V</td><td>[BL через резистор!]</td></tr>
</tbody></table>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-52163145989854953112014-02-16T00:06:00.001+04:002014-02-17T22:56:49.103+04:00Arduino+Arduino<div dir="ltr" style="text-align: left;" trbidi="on">
Попробовал связать 2 Arduino по SPI протоколу. Я не нашел в сети официальной информации о максимальной длине кабеля, по которому можно передавать сигналы по SPI протоколу. Если у вас есть ссылочка на официальную документацию, буду благодарен. А у меня пока есть только мнения на форумах. В основном <a href="http://www.cyberforum.ru/microcontrollers/thread433251.html">считают</a>, что по SPI можно передавать информацию на совсем короткие расстояния. Но <a href="http://forum.arduino.cc/index.php?topic=58288.0">тут</a> человек делится опытом, мол на 300 метров сигнал идёт, и можно использовать большую длину, если делить частоту.<br />
<br />
Поэтому я решил проверить, как будет работать связь между платами по длинному кабелю.<br />
И вот что получилось.<br />
<br />
Сперва соединил 2 платы короткими проводками, чтобы отладить взаимодействие устройств.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/ZfU8EJqlsEY?feature=player_embedded' frameborder='0'></iframe></div>
<a name='more'></a>С кодом как и раньше не заморачивался и сделал на основе <a href="http://greenoakst.blogspot.ru/2012/06/arduino-spi.html">этой</a> статьи.<br />
Код для Master<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"><span style="color: #aeaeae; font-style: italic;">/*</span></pre>
<span style="color: #aeaeae; font-style: italic;"> MASTER
При нажатии на кнопку зажигаем свой светодиод
</span><pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"><span style="color: #aeaeae; font-style: italic;"> и отправляем 1 на ведомый контроллер
</span></pre>
<span style="color: #aeaeae; font-style: italic;"> */</span>
#include <span style="color: #e28964;"><</span><span style="color: #3387cc;">SPI</span><span style="color: #e28964;">.</span>h<span style="color: #e28964;">></span>
#define <span style="color: #3387cc;">SS_PIN</span> <span style="color: #3387cc;">10</span>
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">setup</span>() {
<span style="color: #aeaeae; font-style: italic;">// LED</span>
pinMode(<span style="color: #3387cc;">3</span>, <span style="color: #3387cc;">OUTPUT</span>);
<pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"> <span style="color: #aeaeae; font-style: italic;">// Button</span>
</pre>
pinMode(<span style="color: #3387cc;">5</span>, <span style="color: #3387cc;">INPUT</span>);
pinMode(<span style="color: #3387cc;">SS_PIN</span>, <span style="color: #3387cc;">OUTPUT</span>);
<span style="color: #3387cc;">SPI</span><span style="color: #e28964;">.</span>begin();
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">loop</span>() {
<span style="color: #e28964;">if</span> (digitalRead(<span style="color: #3387cc;">5</span>)) {
<pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"> <span style="color: #aeaeae; font-style: italic;">// S</span><span style="color: #aeaeae; font-style: italic;">et the LED on</span>
</pre>
digitalWrite(<span style="color: #3387cc;">3</span>, <span style="color: #3387cc;">HIGH</span>);
<pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"> <span style="color: #aeaeae; font-style: italic;">// Send 1 to Slave</span>
</pre>
digitalWrite(<span style="color: #3387cc;">SS_PIN</span>, <span style="color: #3387cc;">LOW</span>);
<span style="color: #3387cc;">SPI</span><span style="color: #e28964;">.</span>transfer(<span style="color: #3387cc;">1</span>);
digitalWrite(<span style="color: #3387cc;">SS_PIN</span>, <span style="color: #3387cc;">HIGH</span>);
}
<span style="color: #e28964;">else</span> {
<pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"> <span style="color: #aeaeae; font-style: italic;">// S</span><span style="color: #aeaeae; font-style: italic;">et the LED off</span>
</pre>
digitalWrite(<span style="color: #3387cc;">3</span>, <span style="color: #3387cc;">LOW</span>);
<pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;"> <span style="color: #aeaeae; font-style: italic;">// Send 0 to Slave</span>
</pre>
digitalWrite(<span style="color: #3387cc;">SS_PIN</span>, <span style="color: #3387cc;">LOW</span>);
<span style="color: #3387cc;">SPI</span><span style="color: #e28964;">.</span>transfer(<span style="color: #3387cc;">0</span>);
digitalWrite(<span style="color: #3387cc;">SS_PIN</span>, <span style="color: #3387cc;">HIGH</span>);
}
<pre style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px;">}</pre>
</pre>
<br />
Код для Slave<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">/*
SLAVE
Принимаем сигнал по SPI
и зажигаем светодиод, если сигнал = 1
*/</span>
<span style="color: #aeaeae; font-style: italic;">// Определяем пины SPI</span>
#define <span style="color: #3387cc;">MOSI_PIN</span> <span style="color: #3387cc;">11</span>
#define <span style="color: #3387cc;">MISO_PIN</span> <span style="color: #3387cc;">12</span>
#define <span style="color: #3387cc;">SCK_PIN</span> <span style="color: #3387cc;">13</span>
#define <span style="color: #3387cc;">SS_PIN</span> <span style="color: #3387cc;">10</span>
<span style="color: #99cf50;">byte</span> recievedByte;
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">setup</span>() {
<span style="color: #aeaeae; font-style: italic;">// Обнуляем регистр управления SPI</span>
<span style="color: #3387cc;">SPCR</span> <span style="color: #e28964;">=</span> <span style="color: #3387cc;">B00000000</span>;
<span style="color: #aeaeae; font-style: italic;">// Разрешаем работу SPI</span>
<span style="color: #3387cc;">SPCR</span> <span style="color: #e28964;">=</span> (<span style="color: #3387cc;">1</span><span style="color: #e28964;"><<</span><span style="color: #3387cc;">SPE</span>);
<span style="color: #aeaeae; font-style: italic;">// LED</span>
pinMode(<span style="color: #3387cc;">3</span>, <span style="color: #3387cc;">OUTPUT</span>);
<span style="color: #aeaeae; font-style: italic;">// Определяем пины для работы с SPI</span>
pinMode(<span style="color: #3387cc;">MOSI_PIN</span>, <span style="color: #3387cc;">INPUT</span>);
pinMode(<span style="color: #3387cc;">MISO_PIN</span>, <span style="color: #3387cc;">OUTPUT</span>);
pinMode(<span style="color: #3387cc;">SCK_PIN</span>, <span style="color: #3387cc;">INPUT</span>);
pinMode(<span style="color: #3387cc;">SS_PIN</span>, <span style="color: #3387cc;">INPUT</span>);
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">loop</span>() {
<span style="color: #e28964;">while</span> (digitalRead(<span style="color: #3387cc;">SS_PIN</span>)<span style="color: #e28964;">==</span><span style="color: #3387cc;">LOW</span>) {
<span style="color: #aeaeae; font-style: italic;">// Принимаем байт</span>
recievedByte <span style="color: #e28964;">=</span> spi_receive();
<span style="color: #e28964;">if</span> (recievedByte) {
digitalWrite(<span style="color: #3387cc;">3</span>, <span style="color: #3387cc;">HIGH</span>);
}
<span style="color: #e28964;">else</span> {
digitalWrite(<span style="color: #3387cc;">3</span>, <span style="color: #3387cc;">LOW</span>);
}
}
}
<span style="color: #aeaeae; font-style: italic;">// Приём байта</span>
<span style="color: #99cf50;">byte</span> spi_receive()
{
<span style="color: #aeaeae; font-style: italic;">// Пока не выставлен флаг окончания передачи, принимаем биты</span>
<span style="color: #e28964;">while</span> (<span style="color: #e28964;">!</span>(<span style="color: #3387cc;">SPSR</span> <span style="color: #e28964;">&</span> (<span style="color: #3387cc;">1</span><span style="color: #e28964;"><<</span><span style="color: #3387cc;">SPIF</span>))){};
<span style="color: #aeaeae; font-style: italic;">// Возвращаем содержимое регистра данных SPI</span>
<span style="color: #e28964;">return</span> <span style="color: #3387cc;">SPDR</span>;
}
</pre>
<br />
Заработало с первого раза и без проблем. В Arduino просто напрямую соединил выводы 10 с 10, 11 с 11, 12 с 12 и 13 с 13 короткими проводками. Это видно на первом видео.<br />
<br />
А потом решил опробовать реальный кабель. Взял обычный не экранированный Ethernet кабель длиной чуть больше 20 метров и точно так же соединил контакты. Не работает!!! Вернее то работает, то не работает, никакой стабильности. Сперва думал, что дело в контактах, так как при шевелении кабеля что-то улучшалось. А потом воткнул контакты кабеля в макетную плату, это видно на видео ниже, и начал замыкать контакты параллельно короткими кабелями.<br />
<br />
В итоге оказалось вот что. Оказалось, что я наугад посадил одну витую пару на MOSI (11), MISO (12), а другую витую пару на SCK(13), SS (10) и это, как оказалось, не хорошо. Изменил порядок соединения. Одну витую пару посадил на SS(10), MOSI (11), а другую - на MISO(12), SCK (13). И всё заработало отлично! В спецификации к SPI не нашел информации о соединении по витой паре. Может быть плохо искал. Если есть ссылочка, буду благодарен.<br />
<br />
Вот, длина кабеля чуть больше 20 метров:<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/3tbyW5Q9j4U?feature=player_embedded' frameborder='0'></iframe></div>
<br />
UPD1: Пара ссылок<br />
<a href="http://www.ti.com.cn/cn/lit/an/slyt441/slyt441.pdf">Extending the SPI bus for long-distance communication</a><br />
<a href="http://www.ece.stevens-tech.edu/~bmcnair/ESRT-S05/Class%2013-14.pdf">Architecture, Design and Implementation of Embedded System for Real-Time Applications</a><br />
<br />
UPD2: Информация от инструктора <a href="https://www.edx.org/course/utaustinx/utaustinx-ut-6-01x-embedded-systems-1172">курса</a><br />
<br />
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
See page 1355 of tm4c123gh6pm.pdf. The TM4C123 timing is rated for a maximum of 50 pF load. As the capacitance goes up, the signals rise and fall too slowly.</div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
<a href="http://users.ece.utexas.edu/~valvano/Volume1/tm4c123gh6pm.pdf" style="color: #3c7cc0; cursor: pointer; text-decoration: none;"></a><a href="http://users.ece.utexas.edu/~valvano/Volume1/tm4c123gh6pm.pdf" style="color: #3c7cc0; cursor: pointer; text-decoration: none;" target="_blank">http://users.ece.utexas.edu/~valvano/Volume1/tm4c123gh6pm.pdf</a></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
The simplest solution is RS232 or RS422 added to the UART in chapter 11.</div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16.25px; margin-bottom: 2px; min-height: 15px; word-break: break-word;">
CAN is a nice network for 20m and built into this processor.<a href="http://users.ece.utexas.edu/~valvano/EE345M/view23_CAN.pdf" style="color: #3c7cc0; cursor: pointer; text-decoration: none;"></a><a href="http://users.ece.utexas.edu/~valvano/EE345M/view23_CAN.pdf" style="color: #3c7cc0; cursor: pointer; text-decoration: none;" target="_blank">http://users.ece.utexas.edu/~valvano/EE345M/view23_CAN.pdf</a></div>
</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com1tag:blogger.com,1999:blog-4523257264480589888.post-80148146401336597802014-02-06T02:15:00.003+04:002014-02-06T02:15:35.305+04:00Отладка на LaunchPad<div dir="ltr" style="text-align: left;" trbidi="on">
В процессе изучения разработки на LauncPad мне очень понравилась возможность отладки кода на микроконтроллере. Пока что пробовал в Keil, но думаю, что в CCS по аналогии.<br />
<br />
<a name='more'></a><br />
Ниже простой пример. Мигает зеленый светодиод, пока нажата кнопка SW1.<br />
<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;">"../tm4c123gh6pm.h"</span></span>
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">PortF_Init</span>(void);
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">delay</span>(unsigned long halfsecs);
<span style="color: #99cf50;">int</span> <span style="color: #89bdff;">main</span>(void) {
unsigned long SW1; // input from PF4
PortF_Init();
while (1) {
GPIO_PORTF_DATA_R &= ~0x08;
do {
SW1 = GPIO_PORTF_DATA_R & 0x10; // PF4 into SW1
} while (SW1);
do {
// Invert green light
GPIO_PORTF_DATA_R ^= 0x08;
delay(1);
SW1 = GPIO_PORTF_DATA_R & 0x10; // PF4 into SW1
} while (!SW1);
}
}
<span style="color: #aeaeae; font-style: italic;">// Init port F (PF4 - !in, PF3 - out)</span>
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">PortF_Init</span>(void) {
volatile unsigned long delay;
SYSCTL_RCGC2_R |= 0x00000020; // 1) F clock
delay = SYSCTL_RCGC2_R; // delay
GPIO_PORTF_CR_R |= 0x18; // allow changes to PF4-3
GPIO_PORTF_AMSEL_R &= ~0x18; // 3) disable analog function
GPIO_PORTF_PCTL_R &= 0x00000000; // 4) GPIO clear bit PCTL
GPIO_PORTF_DIR_R &= ~0x10; // 5.1) PF4 input,
GPIO_PORTF_DIR_R |= 0x08; // 5.2) PF3 output
GPIO_PORTF_AFSEL_R &= ~0x18; // 6) no alternate function
GPIO_PORTF_PUR_R |= 0x10; // enable pullup resistors on PF4
GPIO_PORTF_DEN_R |= 0x18; // 7) enable digital pins PF4-PF3
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">delay</span>(unsigned long time) {
unsigned long i;
while (<span style="color: #dad085;">time</span> > 0) {
i = 1234567;
while(i > 0){
i = i - 1;
}
time = time - 1;
}
}
</pre>
<br />
Вот, например, что получается, если поставить привычный брэкпоинт.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/mWibf0QVylU?feature=player_embedded' frameborder='0'></iframe></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-84917596304767157362014-01-17T06:26:00.001+04:002014-01-17T06:26:50.208+04:00Знакомство с LaunchPad от Texas Instruments<div dir="ltr" style="text-align: left;" trbidi="on">
Купил себе для <a href="https://www.edx.org/course/utaustinx/utaustinx-ut-6-01x-embedded-systems-1172">курса</a> модель EK-LM4F120XL. В отличии от EK-TM4C123GXL, моя модель без USB хоста и не поддерживает на аппаратном уровне широтно-импульсную модуляцию.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC4VFCaVIk3l1o_nPJuYM81aYofm7D2dB9CcA_DJyfQl0oQl8yRYMN-QDUndajr0IXZnprAhlxHHVXMneQiH9LxVnt4Zv3EiDHkomna2hEowl7KgipdlUpcvnM_AT_k6vs7lTgmR480fE/s1600/DSC_2180.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC4VFCaVIk3l1o_nPJuYM81aYofm7D2dB9CcA_DJyfQl0oQl8yRYMN-QDUndajr0IXZnprAhlxHHVXMneQiH9LxVnt4Zv3EiDHkomna2hEowl7KgipdlUpcvnM_AT_k6vs7lTgmR480fE/s1600/DSC_2180.JPG" height="240" width="320" /></a></div>
<br />
<a name='more'></a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIgwRawLw9ej5EYCbUYVyXk-EtWKx8Ml1nU9mUAPanpjJ9Dvt9mNlvV4AlKv1RmRerqEzU9n1pTPgG8hbRTbAaanL1VDfIED67PlxA9xciE20ZIF0mgzN9v8IH0RN-iGZo0rlzCzCZk7Q/s1600/DSC_2185.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIgwRawLw9ej5EYCbUYVyXk-EtWKx8Ml1nU9mUAPanpjJ9Dvt9mNlvV4AlKv1RmRerqEzU9n1pTPgG8hbRTbAaanL1VDfIED67PlxA9xciE20ZIF0mgzN9v8IH0RN-iGZo0rlzCzCZk7Q/s1600/DSC_2185.JPG" height="240" width="320" /></a></div>
<br />
В комплекте - одностраничная документация по быстрому старту и micro-USB кабель.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDgHDTjIM7LXFDZk7gSP6-g4Pq8PbeBe_2B6p_lpxIa5YlZGqyYDnmc0QuAlSpthAn51AcUx8BZ0Y9DPTx2Hr22saUDnFW48UtA7jFkIsHHQN4BFhd647UoP0b4wSrDJLCJforqK-kgBk/s1600/DSC_2181.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDgHDTjIM7LXFDZk7gSP6-g4Pq8PbeBe_2B6p_lpxIa5YlZGqyYDnmc0QuAlSpthAn51AcUx8BZ0Y9DPTx2Hr22saUDnFW48UtA7jFkIsHHQN4BFhd647UoP0b4wSrDJLCJforqK-kgBk/s1600/DSC_2181.JPG" height="240" width="320" /></a></div>
<br />
В инструкции говорится о подключении к Windows PC. Преподаватели курса тоже говорят исключительно о Windows или MacOS, но с эмулятором Windows. А у меня Ubuntu. Пошарив по интернетам, нашёл хорошую и краткую <a href="http://ibnteo.klava.org/microcomputer/TM4C123G">инструкцию</a> по заливке кода в контроллер из Linux.<br />
У меня плата LM4F120XL, поэтому шаги слегка различаются. Итак, по-порядку.<br />
<ol style="text-align: left;">
<li>Для компиляции кода для контроллера, устанавливаем пакет arm-none-eabi-gcc.<br /><pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;">$ sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
$ sudo apt-get update
$ sudo apt-get install gcc-arm-none-eabi
</pre>
</li>
<li>Устанавливаем libusb-1.0-0-dev, этот пакет понадобится для lm4flash.<br /><pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;">$ sudo apt-get install libusb-1.0-0-dev
</pre>
</li>
<li>Чтобы код было чем заливать в контроллер, устанавливаем lm4flash (если гит уже есть, иначе просто берём файлы <a href="https://github.com/utzig/lm4tools">отсюда</a>).<br /><pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;">$ git clone https://github.com/utzig/lm4tools.git
$ <span style="color: #dad085;">cd</span> lm4tools/lm4flash/
$ make
$ sudo cp lm4flash /usr/bin/
</pre>
</li>
<li><a href="http://www.ti.com/tool/sw-ek-lm4f120xl">Тут</a> берём архив SW-EK-LM4F120XL. Открываем скаченный .exe с помощью менеджера архивов и копируем содержимое в свой рабочий каталог.</li>
<li>Чтобы убедиться, что всё работает, компилируем и загружаем в контроллер пример. Для этого идём в каталог boards/ek-lm4f120xl/blinky. Этот пример - периодическое включение светодиода, находящегося прямо на плате. Выполняем<br /><pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;">$ make
$ sudo lm4flash gcc/blinky.bin
</pre>
</li>
</ol>
Если светодиод начал мигать, то всё хорошо.<br />
Если желаете восстановить на плате всё, как было, просто скомпилируйте и загрузите на неё пример qs-rgb.</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com1tag:blogger.com,1999:blog-4523257264480589888.post-3713007896361797022014-01-13T01:06:00.002+04:002014-01-13T01:06:43.049+04:00Управление моторчиком 28BYJ-48<div dir="ltr" style="text-align: left;" trbidi="on">
Схема включения нарисована <a href="http://arduino.cc/en/Tutorial/MotorKnob">тут</a>. А <a href="http://www.geeetech.com/wiki/index.php/Stepper_Motor_5V_4-Phase_5-Wire_%26_ULN2003_Driver_Board_for_Arduino">тут</a> - ближе к реальности.<br />
<div>
<div>
<br /></div>
Если посмотреть распайку платы, на которой установлена микросхема ULN2003AN, то становится понятно, что к Arduino подключаем так:<br />
<table>
<tbody>
<tr>
<th>Arduino</th><th>Driver board</th>
</tr>
<tr>
<td>8</td><td>IN1</td>
</tr>
<tr>
<td>9</td><td>IN2</td>
</tr>
<tr>
<td>10</td><td>IN3</td>
</tr>
<tr>
<td>11</td><td>IN4</td>
</tr>
<tr>
<td>GND</td><td>-</td>
</tr>
<tr>
<td>5V</td><td>+</td>
</tr>
</tbody></table>
<br />
<a name='more'></a><br />
Пример взял стандартный из IDE (MotorKnob), добавил только секундную задержку, иначе из-за нестабильности сигнала на аналоговом входе плохо прослеживается зависимость.</div>
<div>
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">/*
* MotorKnob
*
* A stepper motor follows the turns of a potentiometer
* (or other sensor) on analog input 0.
*
* http://www.arduino.cc/en/Reference/Stepper
* This example code is in the public domain.
*/</span>
<span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;"><Stepper.h></span></span>
<span style="color: #aeaeae; font-style: italic;">// change this to the number of steps on your motor</span>
#<span style="color: #e28964;">define</span> <span style="color: #89bdff;">STEPS</span> 100
<span style="color: #aeaeae; font-style: italic;">// create an instance of the stepper class, specifying</span>
<span style="color: #aeaeae; font-style: italic;">// the number of steps of the motor and the pins it's</span>
<span style="color: #aeaeae; font-style: italic;">// attached to</span>
Stepper <span style="color: #89bdff;">stepper</span>(STEPS, 8, 9, 10, 11);
<span style="color: #aeaeae; font-style: italic;">// the previous reading from the analog input</span>
<span style="color: #99cf50;">int</span> previous = <span style="color: #3387cc;">0</span>;
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">setup</span>()
{
// set the speed of the motor to 30 RPMs
stepper.<span style="color: #dad085;">setSpeed</span>(60);
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">loop</span>()
{
// get the sensor value
int val = analogRead(0);
// move a number of steps equal to the change in the
// sensor reading
stepper.<span style="color: #dad085;">step</span>(val - previous);
// remember the previous value of the sensor
previous = val;
delay(1000);
}
</pre>
<br />
Вот что получилось.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/KXtBLvJhARc?feature=player_embedded' frameborder='0'></iframe></div>
<br />
Тут видно, что скорость вращения низкая. Видимо, питание надо давать не с платы, а от другого источника. Ещё, когда разбирал схему, обратил внимание, что моторчик прилично нагрелся, хотя он у меня почти не крутился.</div>
</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-88606178895296634022014-01-11T16:08:00.000+04:002014-01-11T16:08:31.164+04:00Воспроизведение wav на Arduino<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Для дальнейшей работы мне понадобится воспроизвести заранее записанный звук на Adruino. Сделал по <a href="http://compcar.ru/forum/showthread.php?t=5117">этому</a> примеру, там есть информация и о том, как сконвертировать свой звук в нужный формат, я это пока не стал делать. Рингтон взял из архива "PWM Sound.rar". Вот что получилось.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/DvWJzhQpWVc?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
Ниже код, я его слепил в 1 файл.<br />
<br />
<a name='more'></a><br /></div>
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #aeaeae; font-style: italic;">/*
* speaker_pcm
*
* Plays 8-bit PCM audio on pin 11 using pulse-width modulation (PWM).
* For Arduino with Atmega168 at 16 MHz.
*
* Uses two timers. The first changes the sample value 8000 times a second.
* The second holds pin 11 high for 0-255 ticks out of a 256-tick cycle,
* depending on sample value. The second timer repeats 62500 times per second
* (16000000 / 256), much faster than the playback rate (8000 Hz), so
* it almost sounds halfway decent, just really quiet on a PC speaker.
*
* Takes over Timer 1 (16-bit) for the 8000 Hz timer. This breaks PWM
* (analogWrite()) for Arduino pins 9 and 10. Takes Timer 2 (8-bit)
* for the pulse width modulation, breaking PWM for pins 11 & 3.
*
* References:
* http://www.uchobby.com/index.php/2007/11/11/arduino-sound-part-1/
* http://www.atmel.com/dyn/resources/prod_documents/doc2542.pdf
* http://www.evilmadscientist.com/article.php/avrdac
* http://gonium.net/md/2006/12/27/i-will-think-before-i-code/
* http://fly.cc.fer.hr/GDM/articles/sndmus/speaker2.html
* http://www.gamedev.net/reference/articles/article442.asp
*
* Michael Smith <michael@hurts.ca>
*/</span>
<span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;"><stdint.h></span></span>
<span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;"><avr/interrupt.h></span></span>
<span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;"><avr/io.h></span></span>
<span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;"><avr/pgmspace.h></span></span>
#<span style="color: #e28964;">define</span> <span style="color: #89bdff;">SAMPLE_RATE</span> 8000
<span style="color: #aeaeae; font-style: italic;">/*
* The audio data needs to be unsigned, 8-bit, 8000 Hz, and small enough
* to fit in flash. 10000-13000 samples is about the limit.
*
* sounddata.h should look like this:
* const int sounddata_length=10000;
* const unsigned char sounddata_data[] PROGMEM = { ..... };
*
* You can use wav2c from GBA CSS:
* http://thieumsweb.free.fr/english/gbacss.html
* Then add "PROGMEM" in the right place. I hacked it up to dump the samples
* as unsigned rather than signed, but it shouldn't matter.
*
* http://musicthing.blogspot.com/2005/05/tiny-music-makers-pt-4-mac-startup.html
* mplayer -ao pcm macstartup.mp3
* sox audiodump.wav -v 1.32 -c 1 -r 8000 -u -1 macstartup-8000.wav
* sox macstartup-8000.wav macstartup-cut.wav trim 0 10000s
* wav2c macstartup-cut.wav sounddata.h sounddata
*
* (starfox) nb. under sox 12.18 (distributed in CentOS 5), i needed to run
* the following command to convert my wav file to the appropriate format:
* sox audiodump.wav -c 1 -r 8000 -u -b macstartup-8000.wav
*/</span>
<span style="color: #aeaeae; font-style: italic;">// sounddata sound made by wav2c</span>
<span style="color: #aeaeae; font-style: italic;">// (wav2c modified to use unsigned samples)</span>
<span style="color: #aeaeae; font-style: italic;">/* const int sounddata_sampleRate=8000; */</span>
<span style="color: #99cf50;">const</span> <span style="color: #99cf50;">int</span> sounddata_length=<span style="color: #3387cc;">11531</span>;
<span style="color: #99cf50;">const</span> <span style="color: #99cf50;">unsigned</span> <span style="color: #99cf50;">char</span> sounddata_data[] PROGMEM = {
0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x80, 0x80, 0x7C, 0x7E, 0x78, 0x69, 0x5E, 0x6A,
0x87, 0x98, 0x9E, 0x8C, 0x7C, 0x8C, 0x98, 0xBA, 0x9C, 0x9E, 0x78, 0x81, 0x85, 0x93, 0x8C, 0x6C, 0x65, 0x47, 0x7C, 0x5C,
0x88, 0x57, 0x6C, 0x60, 0x75, 0x8E, 0x81, 0x9A, 0x6E, 0xA3, 0x75, 0xB8, 0x80, 0xA6, 0x7E, 0x8E, 0x85, 0x75, 0x7E, 0x5E,
0x88, 0x52, 0x7A, 0x2B, 0x67, 0x3C, 0x8F, 0x7A, 0x8E, 0x69, 0x6A, 0x95, 0x98, 0xE2, 0x95, 0xB1, 0x65, 0xAA, 0x8F, 0xBF,
0x9C, 0x65, 0x6A, 0x39, 0x85, 0x61, 0x95, 0x37, 0x52, 0x37, 0x6A, 0x93, 0x8A, 0x8F, 0x5A, 0x95, 0x81, 0xDF, 0xB1, 0xBA,
0x80, 0x8E, 0x98, 0xA8, 0xBC, 0x6C, 0x77, 0x37, 0x78, 0x5E, 0x8F, 0x4C, 0x4B, 0x43, 0x52, 0x96, 0x7E, 0xA3, 0x52, 0x96,
0x75, 0xD1, 0xBD, 0xB4, 0x98, 0x78, 0xAC, 0x8E, 0xD4, 0x6C, 0x87, 0x37, 0x6E, 0x69, 0x7C, 0x77, 0x30, 0x60, 0x2E, 0x9E,
0x71, 0xAA, 0x60, 0x7E, 0x88, 0x9E, 0xDD, 0x9A, 0xBC, 0x65, 0xAF, 0x87, 0xC6, 0x8F, 0x75, 0x60, 0x47, 0x81, 0x61, 0x8F,
0x34, 0x5C, 0x35, 0x7C, 0x85, 0x91, 0x81, 0x63, 0x95, 0x87, 0xDA, 0xA3, 0xBC, 0x77, 0x9A, 0x93, 0xAF, 0xA8, 0x71, 0x70,
0x40, 0x81, 0x5C, 0x91, 0x40, 0x57, 0x3B, 0x67, 0x8C, 0x83, 0x96, 0x52, 0x98, 0x75, 0xDA, 0xA5, 0xBA, 0x7E, 0x83, 0xA3,
0x98, 0xCA, 0x60, 0x88, 0x2D, 0x83, 0x61, 0x88, 0x60, 0x37, 0x59, 0x3E, 0xA5, 0x69, 0xAA, 0x4E, 0x88, 0x7E, 0xB3, 0xC8,
0x9A, 0xAD, 0x63, 0xB6, 0x87, 0xCA, 0x7A, 0x7A, 0x50, 0x57, 0x81, 0x69, 0x83, 0x2E, 0x5E, 0x37, 0x8E, 0x78, 0x91, 0x6E,
0x69, 0x8A, 0x96, 0xD1, 0x9E, 0xAF, 0x6A, 0xA1, 0x8F, 0xBC, 0x93, 0x75, 0x60, 0x4B, 0x81, 0x63, 0x8E, 0x39, 0x5A, 0x32,
0x7C, 0x7E, 0x8A, 0x80, 0x5A, 0x93, 0x7C, 0xDB, 0x93, 0xBF, 0x6E, 0x96, 0x96, 0xA6, 0xB4, 0x65, 0x80, 0x2E, 0x8F, 0x59,
0x93, 0x47, 0x49, 0x49, 0x53, 0x9F, 0x67, 0xA3, 0x45, 0x98, 0x75, 0xC6, 0xAC, 0xA1, 0x9A, 0x6E, 0xB6, 0x88, 0xC8, 0x67,
0x83, 0x45, 0x71, 0x77, 0x70, 0x71, 0x34, 0x61, 0x3E, 0x98, 0x6E, 0x95, 0x63, 0x78, 0x88, 0xA3, 0xC3, 0x96, 0xAA, 0x6A,
0xA8, 0x8E, 0xBC, 0x80, 0x7C, 0x57, 0x5C, 0x80, 0x69, 0x80, 0x37, 0x60, 0x35, 0x8C, 0x73, 0x91, 0x70, 0x69, 0x8C, 0x8E,
0xD2, 0x8C, 0xBC, 0x65, 0xA6, 0x8C, 0xB4, 0x96, 0x70, 0x75, 0x40, 0x93, 0x57, 0x95, 0x3B, 0x61, 0x3E, 0x71, 0x8A, 0x71,
0x98, 0x4C, 0x9C, 0x70, 0xD1, 0x95, 0xB1, 0x85, 0x80, 0xAA, 0x8F, 0xBC, 0x61, 0x8C, 0x3B, 0x85, 0x69, 0x7C, 0x63, 0x45,
0x5C, 0x49, 0x9C, 0x69, 0x98, 0x59, 0x85, 0x80, 0xB3, 0xB1, 0x96, 0x9E, 0x73, 0xAA, 0x8F, 0xB8, 0x75, 0x83, 0x50, 0x70,
0x78, 0x75, 0x73, 0x43, 0x60, 0x43, 0x9A, 0x6C, 0x96, 0x61, 0x7A, 0x80, 0x9F, 0xBF, 0x8E, 0xB1, 0x63, 0xAD, 0x81, 0xC1,
0x7C, 0x81, 0x63, 0x52, 0x91, 0x5E, 0x91, 0x34, 0x71, 0x39, 0x8C, 0x7C, 0x81, 0x85, 0x5A, 0x9A, 0x78, 0xD6, 0x83, 0xB6,
0x73, 0x93, 0x9E, 0x9F, 0xAA, 0x67, 0x87, 0x3E, 0x93, 0x63, 0x8C, 0x52, 0x5A, 0x53, 0x63, 0x9A, 0x6A, 0x96, 0x55, 0x91,
0x78, 0xBF, 0x9C, 0xA1, 0x8C, 0x77, 0xA5, 0x91, 0xB4, 0x65, 0x87, 0x47, 0x80, 0x75, 0x7E, 0x67, 0x4C, 0x5E, 0x4E, 0x9E,
0x6C, 0x9A, 0x59, 0x87, 0x78, 0xAF, 0xB1, 0x91, 0xA5, 0x6A, 0xAD, 0x87, 0xC1, 0x70, 0x88, 0x55, 0x6E, 0x88, 0x6E, 0x85,
0x3C, 0x73, 0x3C, 0x9E, 0x6E, 0x8F, 0x6E, 0x6E, 0x8E, 0x8A, 0xC8, 0x7C, 0xB4, 0x61, 0xA5, 0x8C, 0xAF, 0x8E, 0x6E, 0x75,
0x4C, 0x9C, 0x60, 0x8C, 0x42, 0x6A, 0x4B, 0x81, 0x8C, 0x75, 0x8A, 0x57, 0x98, 0x80, 0xCA, 0x88, 0xA6, 0x78, 0x8C, 0xA1,
0x9F, 0xA6, 0x63, 0x83, 0x47, 0x96, 0x6C, 0x8A, 0x53, 0x59, 0x5C, 0x69, 0x9E, 0x6A, 0x95, 0x50, 0x95, 0x78, 0xC1, 0x98,
0x96, 0x8A, 0x71, 0xAF, 0x8C, 0xBA, 0x5E, 0x87, 0x49, 0x88, 0x7E, 0x7E, 0x70, 0x42, 0x70, 0x4E, 0xAC, 0x6A, 0x96, 0x57,
0x7C, 0x87, 0xA6, 0xBA, 0x81, 0xA3, 0x60, 0xB3, 0x8C, 0xBC, 0x77, 0x75, 0x63, 0x67, 0x98, 0x6E, 0x8A, 0x3B, 0x70, 0x4C,
0x9C, 0x7E, 0x85, 0x6E, 0x61, 0x93, 0x8E, 0xCA, 0x7C, 0xA5, 0x61, 0xA1, 0x98, 0xAD, 0x91, 0x69, 0x73, 0x53, 0x9F, 0x6A,
0x93, 0x40, 0x63, 0x52, 0x81, 0x93, 0x75, 0x85, 0x4C, 0x9A, 0x7C, 0xCB, 0x87, 0x9E, 0x70, 0x85, 0xAA, 0x9A, 0xB1, 0x5A,
0x83, 0x49, 0x9F, 0x75, 0x8E, 0x5A, 0x4E, 0x67, 0x61, 0xAA, 0x69, 0x93, 0x45, 0x8C, 0x81, 0xB8, 0xA3, 0x85, 0x8A, 0x6A,
0xB4, 0x8C, 0xBD, 0x65, 0x7E, 0x53, 0x81, 0x8E, 0x7E, 0x77, 0x39, 0x70, 0x55, 0xAA, 0x73, 0x8C, 0x53, 0x75, 0x8A, 0x9E,
0xB8, 0x7E, 0x98, 0x5C, 0xB1, 0x8E, 0xBF, 0x7C, 0x71, 0x65, 0x6E, 0xA1, 0x71, 0x8F, 0x34, 0x71, 0x4E, 0x9E, 0x81, 0x83,
0x6A, 0x55, 0x98, 0x87, 0xCD, 0x78, 0x9E, 0x5C, 0xA1, 0x9A, 0xAC, 0x9E, 0x5E, 0x7C, 0x52, 0xA8, 0x71, 0x9A, 0x42, 0x5A,
0x5C, 0x7E, 0x9E, 0x6E, 0x81, 0x3E, 0x96, 0x7A, 0xC6, 0x8F, 0x8F, 0x70, 0x7E, 0xB1, 0x9A, 0xBC, 0x5A, 0x7E, 0x53, 0x9E,
0x83, 0x8F, 0x60, 0x45, 0x6A, 0x63, 0xA8, 0x6E, 0x8C, 0x40, 0x81, 0x81, 0xB3, 0xA8, 0x81, 0x81, 0x67, 0xB6, 0x8F, 0xC6,
0x67, 0x78, 0x57, 0x83, 0x93, 0x83, 0x80, 0x30, 0x6E, 0x52, 0xAA, 0x75, 0x8C, 0x4C, 0x69, 0x8E, 0x96, 0xC4, 0x78, 0x95,
0x57, 0xB3, 0x95, 0xC3, 0x87, 0x67, 0x69, 0x69, 0xA8, 0x77, 0x96, 0x30, 0x67, 0x50, 0x93, 0x8C, 0x80, 0x6C, 0x49, 0x96,
0x81, 0xCF, 0x81, 0x95, 0x5C, 0x9A, 0xA1, 0xAD, 0xA8, 0x59, 0x78, 0x50, 0xA6, 0x78, 0x9A, 0x45, 0x50, 0x5A, 0x78, 0x9F,
0x73, 0x80, 0x37, 0x93, 0x78, 0xC8, 0x96, 0x8E, 0x70, 0x78, 0xB3, 0x9C, 0xC4, 0x5E, 0x7A, 0x4C, 0x9C, 0x85, 0x91, 0x65,
0x3B, 0x6A, 0x5C, 0xAC, 0x71, 0x8E, 0x3C, 0x7E, 0x83, 0xB1, 0xB6, 0x81, 0x83, 0x60, 0xB8, 0x8F, 0xCA, 0x6E, 0x70, 0x57,
0x7C, 0x96, 0x81, 0x85, 0x2B, 0x69, 0x4E, 0xA8, 0x7C, 0x8A, 0x4E, 0x5C, 0x8F, 0x93, 0xCB, 0x7E, 0x95, 0x55, 0xAA, 0x95,
0xC1, 0x8F, 0x63, 0x65, 0x60, 0xA8, 0x77, 0x9C, 0x32, 0x60, 0x50, 0x8F, 0x91, 0x81, 0x70, 0x43, 0x95, 0x80, 0xD2, 0x8A,
0x95, 0x5C, 0x91, 0xA5, 0xAA, 0xAF, 0x57, 0x75, 0x4B, 0xA1, 0x7A, 0x9C, 0x4C, 0x4B, 0x5A, 0x71, 0xA6, 0x77, 0x87, 0x37,
0x8C, 0x7C, 0xC6, 0xA1, 0x8C, 0x71, 0x71, 0xAF, 0x9A, 0xC8, 0x60, 0x78, 0x47, 0x93, 0x87, 0x93, 0x70, 0x35, 0x65, 0x55,
0xB1, 0x75, 0x93, 0x40, 0x75, 0x81, 0xAC, 0xBD, 0x81, 0x87, 0x57, 0xB3, 0x91, 0xCA, 0x77, 0x6C, 0x53, 0x71, 0x9A, 0x81,
0x8E, 0x2E, 0x65, 0x4B, 0xA3, 0x85, 0x8F, 0x59, 0x57, 0x8E, 0x8F, 0xD1, 0x81, 0x96, 0x53, 0xA3, 0x95, 0xBF, 0x96, 0x61,
0x65, 0x55, 0xA5, 0x7A, 0x9F, 0x37, 0x59, 0x50, 0x8A, 0x9A, 0x81, 0x77, 0x3E, 0x91, 0x7C, 0xD4, 0x8E, 0x98, 0x5C, 0x83,
0xA5, 0xA8, 0xB8, 0x59, 0x71, 0x42, 0x9F, 0x7C, 0x9E, 0x52, 0x43, 0x59, 0x6A, 0xAD, 0x78, 0x8E, 0x37, 0x87, 0x7C, 0xC3,
0xA8, 0x8C, 0x77, 0x63, 0xAF, 0x95, 0xCA, 0x63, 0x73, 0x43, 0x88, 0x8E, 0x8F, 0x77, 0x34, 0x63, 0x53, 0xB1, 0x7E, 0x96,
0x47, 0x70, 0x80, 0xAD, 0xC1, 0x85, 0x88, 0x50, 0xAC, 0x8F, 0xCA, 0x78, 0x6A, 0x52, 0x69, 0x9E, 0x81, 0x93, 0x2E, 0x67,
0x45, 0xA8, 0x8C, 0x8F, 0x61, 0x4E, 0x8E, 0x8C, 0xD8, 0x81, 0x96, 0x4C, 0x96, 0x98, 0xBA, 0x9E, 0x5C, 0x65, 0x49, 0xA8,
0x7C, 0xA1, 0x3E, 0x53, 0x4E, 0x85, 0xA8, 0x83, 0x80, 0x3C, 0x8A, 0x7E, 0xD2, 0x96, 0x95, 0x5E, 0x77, 0xA5, 0xA8, 0xBC,
0x5E, 0x6E, 0x3E, 0x9A, 0x85, 0xA1, 0x5C, 0x45, 0x55, 0x69, 0xB4, 0x7C, 0x95, 0x37, 0x7E, 0x77, 0xC4, 0xAC, 0x8A, 0x75,
0x59, 0xAC, 0x96, 0xCF, 0x67, 0x73, 0x3E, 0x80, 0x96, 0x91, 0x81, 0x34, 0x61, 0x4E, 0xB4, 0x83, 0x98, 0x4C, 0x61, 0x7C,
0xA6, 0xCD, 0x83, 0x8E, 0x47, 0x9F, 0x96, 0xCA, 0x87, 0x69, 0x52, 0x5E, 0xA1, 0x87, 0x9C, 0x34, 0x5E, 0x42, 0xA1, 0x96,
0x91, 0x6A, 0x47, 0x81, 0x8A, 0xD6, 0x8A, 0x98, 0x4E, 0x8A, 0x95, 0xBF, 0xA5, 0x65, 0x61, 0x3E, 0xA5, 0x81, 0xA8, 0x47,
0x53, 0x43, 0x80, 0xAA, 0x88, 0x8C, 0x37, 0x80, 0x73, 0xD8, 0x9C, 0x96, 0x60, 0x65, 0xA5, 0xA5, 0xC8, 0x61, 0x75, 0x35,
0x8F, 0x8A, 0xA5, 0x6A, 0x40, 0x52, 0x57, 0xBA, 0x81, 0x9E, 0x3E, 0x6E, 0x70, 0xBC, 0xB8, 0x8F, 0x7C, 0x4B, 0xA1, 0x91,
0xD4, 0x73, 0x75, 0x3E, 0x6E, 0x9A, 0x93, 0x8E, 0x35, 0x5E, 0x43, 0xB1, 0x8A, 0x9F, 0x59, 0x59, 0x7A, 0x9A, 0xCF, 0x88,
0x95, 0x45, 0x8F, 0x93, 0xC8, 0x93, 0x6E, 0x53, 0x52, 0x9C, 0x88, 0xA1, 0x40, 0x5C, 0x3B, 0x96, 0x9A, 0x98, 0x75, 0x49,
0x7A, 0x83, 0xDA, 0x8E, 0xA1, 0x4B, 0x80, 0x8F, 0xB8, 0xAF, 0x69, 0x6C, 0x34, 0x9F, 0x80, 0xB1, 0x52, 0x55, 0x40, 0x75,
0xB3, 0x85, 0x9A, 0x39, 0x83, 0x6C, 0xD1, 0xA3, 0x96, 0x6E, 0x55, 0x9E, 0x9A, 0xCB, 0x65, 0x77, 0x34, 0x87, 0x8F, 0x9E,
0x78, 0x40, 0x59, 0x52, 0xB4, 0x87, 0x9E, 0x50, 0x6A, 0x77, 0xB3, 0xBC, 0x8F, 0x83, 0x4B, 0x96, 0x91, 0xC6, 0x7A, 0x77,
0x45, 0x67, 0x95, 0x93, 0x91, 0x45, 0x5A, 0x42, 0xAC, 0x8C, 0xA1, 0x60, 0x5E, 0x73, 0x98, 0xCB, 0x8C, 0x9A, 0x43, 0x8E,
0x81, 0xCA, 0x8E, 0x75, 0x57, 0x47, 0x9F, 0x7E, 0xAD, 0x43, 0x69, 0x39, 0x91, 0x9C, 0x93, 0x88, 0x45, 0x81, 0x73, 0xDB,
0x8A, 0xA3, 0x55, 0x70, 0x93, 0xA3, 0xB8, 0x61, 0x7A, 0x34, 0x95, 0x83, 0xA5, 0x69, 0x55, 0x50, 0x69, 0xAF, 0x85, 0x9A,
0x4B, 0x77, 0x70, 0xBF, 0xA5, 0x96, 0x75, 0x59, 0x8C, 0x96, 0xBF, 0x70, 0x7A, 0x39, 0x80, 0x87, 0x9F, 0x7E, 0x53, 0x59,
0x50, 0xAC, 0x83, 0xA8, 0x52, 0x73, 0x63, 0xAF, 0xB4, 0x8F, 0x8F, 0x47, 0x98, 0x7C, 0xCB, 0x77, 0x83, 0x4B, 0x60, 0x93,
0x87, 0xA5, 0x47, 0x71, 0x37, 0xA6, 0x8A, 0x9E, 0x73, 0x57, 0x7C, 0x80, 0xCD, 0x83, 0xA3, 0x4C, 0x81, 0x85, 0xB1, 0x9C,
0x6E, 0x6A, 0x42, 0x9C, 0x7E, 0xA6, 0x59, 0x65, 0x49, 0x80, 0xA1, 0x8E, 0x8F, 0x50, 0x78, 0x75, 0xC6, 0x93, 0x9C, 0x60,
0x6E, 0x88, 0x9F, 0xAD, 0x6E, 0x78, 0x3E, 0x8E, 0x7E, 0xAA, 0x69, 0x63, 0x52, 0x6C, 0xAA, 0x85, 0xA3, 0x4E, 0x81, 0x63,
0xBC, 0x9C, 0x9A, 0x7A, 0x57, 0x91, 0x83, 0xC4, 0x67, 0x88, 0x39, 0x7E, 0x85, 0x96, 0x8A, 0x52, 0x70, 0x47, 0xB1, 0x7C,
0xAA, 0x5C, 0x6E, 0x70, 0x96, 0xBA, 0x83, 0x9A, 0x47, 0x95, 0x7C, 0xBA, 0x80, 0x78, 0x5A, 0x5A, 0x96, 0x83, 0xA1, 0x52,
0x71, 0x49, 0x9A, 0x91, 0x96, 0x78, 0x5E, 0x7A, 0x80, 0xBD, 0x87, 0x9C, 0x55, 0x81, 0x7E, 0xAD, 0x93, 0x75, 0x6A, 0x4E,
0x95, 0x7A, 0xA6, 0x59, 0x77, 0x49, 0x85, 0x93, 0x8E, 0x8F, 0x52, 0x83, 0x67, 0xC6, 0x83, 0xA3, 0x61, 0x73, 0x88, 0x91,
0xB1, 0x65, 0x8A, 0x39, 0x93, 0x75, 0xA6, 0x73, 0x63, 0x67, 0x5E, 0xAD, 0x77, 0xA6, 0x50, 0x81, 0x69, 0xA8, 0x9F, 0x88,
0x85, 0x55, 0x93, 0x7E, 0xB8, 0x70, 0x83, 0x4E, 0x75, 0x8A, 0x8E, 0x8C, 0x5A, 0x73, 0x53, 0xA1, 0x81, 0xA1, 0x69, 0x73,
0x71, 0x93, 0xAD, 0x87, 0x8F, 0x55, 0x8E, 0x78, 0xB3, 0x7A, 0x83, 0x5C, 0x65, 0x8E, 0x80, 0xA3, 0x53, 0x7E, 0x47, 0x9F,
0x85, 0x9C, 0x77, 0x63, 0x83, 0x77, 0xBD, 0x77, 0xA5, 0x52, 0x8A, 0x78, 0xA1, 0x98, 0x6E, 0x7C, 0x47, 0x9F, 0x70, 0xAA,
0x5A, 0x77, 0x5E, 0x7E, 0x9E, 0x81, 0x9A, 0x50, 0x8E, 0x67, 0xB8, 0x88, 0x93, 0x6E, 0x6A, 0x8F, 0x88, 0xAD, 0x69, 0x83,
0x50, 0x8E, 0x80, 0x9A, 0x78, 0x63, 0x6C, 0x67, 0xA8, 0x7E, 0x9E, 0x57, 0x81, 0x71, 0xA6, 0x96, 0x88, 0x7E, 0x60, 0x91,
0x7A, 0xB1, 0x6A, 0x87, 0x52, 0x80, 0x87, 0x8F, 0x88, 0x59, 0x7A, 0x59, 0xAA, 0x77, 0x9F, 0x60, 0x7A, 0x78, 0x8E, 0xAF,
0x78, 0x95, 0x4E, 0x9A, 0x75, 0xAF, 0x78, 0x7A, 0x6A, 0x69, 0x9C, 0x75, 0xA5, 0x50, 0x81, 0x57, 0x9A, 0x8A, 0x8E, 0x7C,
0x5E, 0x8E, 0x75, 0xBA, 0x75, 0x96, 0x57, 0x87, 0x83, 0x96, 0x96, 0x65, 0x7C, 0x55, 0x9E, 0x78, 0xA3, 0x5E, 0x71, 0x65,
0x81, 0x9C, 0x7E, 0x91, 0x52, 0x8E, 0x70, 0xB1, 0x87, 0x8F, 0x67, 0x70, 0x8E, 0x88, 0xA8, 0x61, 0x85, 0x4E, 0x9A, 0x7E,
0x9E, 0x75, 0x65, 0x75, 0x6C, 0xAA, 0x77, 0x9F, 0x4E, 0x88, 0x70, 0xA6, 0x96, 0x80, 0x80, 0x55, 0x9F, 0x75, 0xB6, 0x67,
0x81, 0x57, 0x81, 0x91, 0x88, 0x95, 0x4C, 0x83, 0x59, 0xAD, 0x7C, 0x96, 0x63, 0x6A, 0x87, 0x87, 0xB1, 0x75, 0x8E, 0x4E,
0x95, 0x7E, 0xA8, 0x81, 0x6E, 0x6C, 0x69, 0xA3, 0x80, 0x9F, 0x55, 0x77, 0x61, 0x9A, 0x8C, 0x91, 0x75, 0x5A, 0x88, 0x7A,
0xB6, 0x77, 0x8F, 0x52, 0x85, 0x85, 0x9C, 0x93, 0x67, 0x75, 0x55, 0xA6, 0x77, 0xAC, 0x59, 0x71, 0x63, 0x87, 0xA3, 0x7E,
0x91, 0x47, 0x8F, 0x6C, 0xB6, 0x81, 0x8C, 0x61, 0x69, 0x98, 0x83, 0xB3, 0x5A, 0x81, 0x50, 0x9C, 0x87, 0x9A, 0x7E, 0x5A,
0x7A, 0x6A, 0xB1, 0x78, 0x9E, 0x4E, 0x7A, 0x78, 0x9C, 0x9F, 0x7A, 0x7A, 0x52, 0x9A, 0x7A, 0xB1, 0x6C, 0x7A, 0x59, 0x81,
0x95, 0x8C, 0x98, 0x52, 0x7E, 0x60, 0xAC, 0x81, 0x9A, 0x5E, 0x6A, 0x81, 0x88, 0xAF, 0x73, 0x8C, 0x47, 0x95, 0x78, 0xAA,
0x83, 0x70, 0x69, 0x67, 0xA5, 0x80, 0xAA, 0x53, 0x80, 0x5E, 0x9E, 0x8F, 0x8C, 0x80, 0x50, 0x8E, 0x73, 0xBA, 0x77, 0x8F,
0x50, 0x7E, 0x87, 0x93, 0x9E, 0x61, 0x7E, 0x52, 0xA6, 0x7A, 0xAA, 0x67, 0x69, 0x6A, 0x81, 0xA5, 0x80, 0x91, 0x47, 0x8A,
0x71, 0xAD, 0x87, 0x88, 0x65, 0x61, 0x93, 0x83, 0xAF, 0x65, 0x7C, 0x50, 0x98, 0x88, 0x9F, 0x80, 0x5C, 0x75, 0x6E, 0xAD,
0x7C, 0x9F, 0x4E, 0x7C, 0x75, 0x9F, 0x9E, 0x7E, 0x78, 0x4E, 0x9C, 0x75, 0xB4, 0x6A, 0x7A, 0x55, 0x80, 0x96, 0x8A, 0xA1,
0x50, 0x81, 0x5A, 0xAF, 0x81, 0x9E, 0x63, 0x60, 0x87, 0x80, 0xB4, 0x71, 0x8F, 0x45, 0x8E, 0x7C, 0xA3, 0x8A, 0x69, 0x6C,
0x60, 0xA6, 0x7E, 0xAC, 0x5A, 0x78, 0x65, 0x93, 0x96, 0x8C, 0x83, 0x52, 0x87, 0x75, 0xB1, 0x80, 0x8C, 0x52, 0x78, 0x87,
0x8F, 0x9A, 0x65, 0x75, 0x55, 0x9F, 0x7C, 0xAA, 0x6E, 0x71, 0x69, 0x83, 0xA3, 0x83, 0x98, 0x49, 0x8A, 0x6C, 0xAC, 0x83,
0x8A, 0x67, 0x60, 0x8F, 0x77, 0xAF, 0x61, 0x85, 0x4C, 0x95, 0x85, 0x9C, 0x8C, 0x5C, 0x80, 0x69, 0xAF, 0x78, 0xA5, 0x59,
0x7A, 0x77, 0x91, 0x9E, 0x7A, 0x83, 0x4B, 0x96, 0x70, 0xA8, 0x73, 0x78, 0x61, 0x77, 0x96, 0x85, 0xA3, 0x5E, 0x83, 0x61,
0xA5, 0x85, 0x9A, 0x6E, 0x63, 0x83, 0x7E, 0xA8, 0x75, 0x8C, 0x4C, 0x88, 0x75, 0x9E, 0x87, 0x71, 0x6C, 0x61, 0xA1, 0x7C,
0xAC, 0x63, 0x80, 0x67, 0x96, 0x91, 0x8E, 0x88, 0x57, 0x8C, 0x6A, 0xAD, 0x77, 0x93, 0x53, 0x75, 0x83, 0x85, 0x9C, 0x63,
0x81, 0x50, 0xA3, 0x77, 0xA6, 0x77, 0x71, 0x78, 0x77, 0xA8, 0x7A, 0x9E, 0x4E, 0x88, 0x6E, 0x9F, 0x88, 0x80, 0x75, 0x5C,
0x95, 0x73, 0xA8, 0x67, 0x81, 0x5C, 0x8A, 0x8C, 0x93, 0x91, 0x65, 0x83, 0x70, 0xA8, 0x7E, 0x9C, 0x61, 0x7A, 0x7A, 0x8A,
0x95, 0x78, 0x83, 0x55, 0x91, 0x73, 0xA1, 0x71, 0x7E, 0x61, 0x80, 0x95, 0x85, 0x9E, 0x5E, 0x8C, 0x65, 0xA5, 0x7C, 0x96,
0x70, 0x6A, 0x85, 0x78, 0xA8, 0x6A, 0x93, 0x4C, 0x8F, 0x73, 0x96, 0x83, 0x6E, 0x7C, 0x61, 0xA6, 0x73, 0xAC, 0x63, 0x85,
0x70, 0x91, 0x98, 0x7E, 0x8F, 0x53, 0x93, 0x6C, 0xA8, 0x73, 0x88, 0x67, 0x71, 0x8E, 0x7A, 0x9C, 0x61, 0x85, 0x5E, 0x9C,
0x81, 0x96, 0x7A, 0x71, 0x83, 0x7C, 0xA1, 0x78, 0x91, 0x5A, 0x85, 0x73, 0x98, 0x83, 0x7A, 0x71, 0x67, 0x8F, 0x77, 0x9F,
0x65, 0x81, 0x60, 0x93, 0x88, 0x93, 0x88, 0x69, 0x88, 0x70, 0xAC, 0x73, 0x9C, 0x5C, 0x7E, 0x7A, 0x8C, 0x96, 0x6C, 0x87,
0x52, 0x9C, 0x6C, 0xA1, 0x6C, 0x78, 0x70, 0x77, 0xA1, 0x78, 0xA1, 0x59, 0x8F, 0x6C, 0xA3, 0x85, 0x87, 0x78, 0x60, 0x8E,
0x71, 0xA8, 0x67, 0x87, 0x57, 0x85, 0x81, 0x88, 0x85, 0x65, 0x7E, 0x69, 0xA5, 0x80, 0x9F, 0x6A, 0x80, 0x7A, 0x91, 0x98,
0x80, 0x81, 0x5C, 0x8C, 0x75, 0xA5, 0x70, 0x80, 0x60, 0x78, 0x8C, 0x83, 0x95, 0x5C, 0x83, 0x5E, 0xA5, 0x80, 0x9E, 0x73,
0x75, 0x83, 0x81, 0xAA, 0x70, 0x91, 0x50, 0x8F, 0x70, 0x9C, 0x83, 0x71, 0x75, 0x5E, 0x9A, 0x71, 0xA3, 0x59, 0x80, 0x63,
0x91, 0x98, 0x87, 0x91, 0x60, 0x96, 0x70, 0xB1, 0x7A, 0x8C, 0x61, 0x73, 0x85, 0x85, 0x9E, 0x61, 0x81, 0x57, 0x95, 0x7A,
0x95, 0x71, 0x6A, 0x73, 0x77, 0xA1, 0x85, 0x96, 0x60, 0x8C, 0x75, 0xA5, 0x8C, 0x81, 0x70, 0x65, 0x8A, 0x7C, 0x9F, 0x67,
0x80, 0x57, 0x88, 0x80, 0x91, 0x80, 0x61, 0x7C, 0x69, 0xAA, 0x80, 0xA1, 0x63, 0x88, 0x7C, 0x98, 0x9E, 0x77, 0x85, 0x52,
0x96, 0x6E, 0xAC, 0x6C, 0x78, 0x63, 0x70, 0x96, 0x7A, 0x9A, 0x52, 0x87, 0x5C, 0xA3, 0x8A, 0x95, 0x7C, 0x69, 0x91, 0x7A,
0xB6, 0x71, 0x8A, 0x55, 0x81, 0x7C, 0x93, 0x8A, 0x63, 0x75, 0x5C, 0x98, 0x7A, 0x9E, 0x60, 0x73, 0x6A, 0x88, 0xA1, 0x8C,
0x8A, 0x63, 0x8E, 0x7C, 0xB1, 0x80, 0x88, 0x60, 0x73, 0x83, 0x8A, 0x9A, 0x61, 0x7A, 0x53, 0x95, 0x7C, 0x9F, 0x69, 0x69,
0x70, 0x78, 0xAA, 0x81, 0x9F, 0x57, 0x91, 0x75, 0xAA, 0x95, 0x7E, 0x71, 0x5A, 0x91, 0x73, 0xAD, 0x5C, 0x7A, 0x55, 0x81,
0x8C, 0x8C, 0x8C, 0x52, 0x83, 0x63, 0xAD, 0x8A, 0x9C, 0x69, 0x7A, 0x87, 0x91, 0xAF, 0x73, 0x83, 0x52, 0x8A, 0x78, 0xA1,
0x7A, 0x6A, 0x67, 0x69, 0x95, 0x85, 0x98, 0x55, 0x78, 0x61, 0x9C, 0x96, 0x95, 0x7C, 0x67, 0x8A, 0x83, 0xB4, 0x81, 0x85,
0x52, 0x7E, 0x7A, 0x9C, 0x8A, 0x63, 0x70, 0x5A, 0x96, 0x80, 0xA1, 0x5E, 0x75, 0x65, 0x8C, 0xA3, 0x91, 0x8F, 0x5A, 0x93,
0x77, 0xBC, 0x85, 0x87, 0x5E, 0x6A, 0x88, 0x81, 0xA5, 0x57, 0x7C, 0x4E, 0x8F, 0x83, 0x9C, 0x73, 0x5C, 0x78, 0x6E, 0xB3,
0x85, 0x9C, 0x5C, 0x87, 0x7E, 0xA3, 0xA3, 0x7A, 0x77, 0x55, 0x8E, 0x78, 0xAA, 0x67, 0x70, 0x59, 0x77, 0x8F, 0x8F, 0x8A,
0x57, 0x7A, 0x63, 0xA8, 0x91, 0x9E, 0x6C, 0x75, 0x87, 0x93, 0xB4, 0x7A, 0x83, 0x4E, 0x87, 0x77, 0xA5, 0x7A, 0x67, 0x61,
0x63, 0x96, 0x85, 0xA1, 0x52, 0x77, 0x60, 0x9A, 0x9C, 0x96, 0x81, 0x63, 0x8E, 0x80, 0xBC, 0x81, 0x8C, 0x53, 0x75, 0x7A,
0x95, 0x95, 0x5A, 0x6E, 0x50, 0x95, 0x80, 0xA3, 0x61, 0x6E, 0x69, 0x80, 0xAC, 0x8E, 0x9A, 0x59, 0x8E, 0x77, 0xB6, 0x95,
0x85, 0x67, 0x60, 0x88, 0x7E, 0xA8, 0x5E, 0x77, 0x4E, 0x83, 0x88, 0x98, 0x81, 0x5A, 0x75, 0x67, 0xAF, 0x8E, 0x9E, 0x63,
0x80, 0x7C, 0xA1, 0xAA, 0x80, 0x7C, 0x50, 0x87, 0x73, 0xAC, 0x70, 0x6E, 0x53, 0x6C, 0x8F, 0x8E, 0x96, 0x57, 0x7A, 0x5E,
0xA5, 0x95, 0x9F, 0x75, 0x70, 0x83, 0x8A, 0xBC, 0x85, 0x8A, 0x4C, 0x80, 0x73, 0xA1, 0x85, 0x67, 0x65, 0x55, 0x95, 0x83,
0xA6, 0x5E, 0x73, 0x5C, 0x8E, 0xA1, 0x98, 0x8E, 0x60, 0x8A, 0x78, 0xBC, 0x88, 0x8E, 0x5E, 0x6A, 0x7E, 0x8A, 0x9E, 0x61,
0x71, 0x49, 0x8C, 0x81, 0xA1, 0x73, 0x67, 0x6C, 0x75, 0xAA, 0x91, 0x9E, 0x61, 0x85, 0x75, 0xAF, 0x9C, 0x8C, 0x70, 0x5A,
0x81, 0x7C, 0xAA, 0x65, 0x75, 0x4C, 0x7A, 0x85, 0x96, 0x8A, 0x61, 0x73, 0x60, 0xAA, 0x8E, 0xA8, 0x67, 0x7A, 0x78, 0x96,
0xAF, 0x85, 0x87, 0x4E, 0x83, 0x70, 0xA6, 0x77, 0x71, 0x59, 0x5E, 0x8E, 0x87, 0xA3, 0x5A, 0x7A, 0x5C, 0x9C, 0x98, 0xA1,
0x83, 0x6A, 0x85, 0x80, 0xBA, 0x85, 0x91, 0x53, 0x75, 0x75, 0x95, 0x8C, 0x67, 0x69, 0x50, 0x8E, 0x7E, 0xA5, 0x69, 0x75,
0x61, 0x83, 0xA3, 0x96, 0x98, 0x61, 0x87, 0x75, 0xB4, 0x91, 0x91, 0x63, 0x65, 0x7A, 0x81, 0xA1, 0x65, 0x77, 0x45, 0x85,
0x7E, 0x9F, 0x7E, 0x69, 0x70, 0x6E, 0xA8, 0x8E, 0xA6, 0x65, 0x85, 0x73, 0xA3, 0xA1, 0x8E, 0x7C, 0x52, 0x81, 0x73, 0xA5,
0x6E, 0x75, 0x50, 0x70, 0x85, 0x8E, 0x96, 0x61, 0x78, 0x5C, 0xA5, 0x8F, 0xA8, 0x77, 0x73, 0x7C, 0x8E, 0xAF, 0x87, 0x8C,
0x50, 0x7E, 0x6E, 0x9C, 0x7E, 0x70, 0x60, 0x57, 0x8A, 0x83, 0xA5, 0x65, 0x78, 0x5C, 0x96, 0x98, 0x9F, 0x8E, 0x69, 0x87,
0x7A, 0xB6, 0x8A, 0x96, 0x5A, 0x70, 0x73, 0x8C, 0x95, 0x67, 0x6C, 0x49, 0x8C, 0x7A, 0xA5, 0x75, 0x73, 0x67, 0x7A, 0xA1,
0x95, 0xA1, 0x63, 0x83, 0x73, 0xAF, 0x96, 0x93, 0x6E, 0x5C, 0x7E, 0x77, 0x9F, 0x69, 0x77, 0x47, 0x78, 0x7C, 0x9C, 0x8A,
0x69, 0x70, 0x67, 0xA8, 0x8F, 0xAC, 0x6C, 0x7E, 0x7A, 0x9A, 0xA6, 0x8E, 0x85, 0x50, 0x7C, 0x6C, 0xA3, 0x75, 0x75, 0x50,
0x65, 0x87, 0x88, 0x9C, 0x63, 0x78, 0x5E, 0x9C, 0x91, 0xA8, 0x81, 0x6E, 0x80, 0x85, 0xB4, 0x88, 0x95, 0x50, 0x77, 0x70,
0x93, 0x88, 0x6E, 0x63, 0x52, 0x88, 0x7E, 0xA8, 0x6E, 0x77, 0x5E, 0x8A, 0x9E, 0x9E, 0x98, 0x65, 0x88, 0x78, 0xB3, 0x91,
0x98, 0x61, 0x67, 0x73, 0x83, 0x9A, 0x6A, 0x70, 0x43, 0x83, 0x7A, 0xA1, 0x7E, 0x70, 0x69, 0x73, 0xA3, 0x91, 0xAA, 0x65,
0x83, 0x70, 0xA8, 0x9F, 0x93, 0x78, 0x53, 0x80, 0x70, 0xA1, 0x6E, 0x73, 0x49, 0x70, 0x7E, 0x93, 0x95, 0x65, 0x75, 0x60,
0xA3, 0x91, 0xAC, 0x75, 0x73, 0x7C, 0x93, 0xAD, 0x8F, 0x8C, 0x50, 0x7A, 0x6C, 0x9E, 0x7E, 0x71, 0x53, 0x59, 0x88, 0x83,
0xA3, 0x69, 0x75, 0x5E, 0x96, 0x95, 0xA6, 0x8C, 0x6A, 0x80, 0x7E, 0xB4, 0x8F, 0x9C, 0x55, 0x70, 0x70, 0x8E, 0x8F, 0x6E,
0x67, 0x47, 0x87, 0x77, 0xAA, 0x73, 0x75, 0x63, 0x7E, 0xA3, 0x98, 0xA3, 0x63, 0x85, 0x75, 0xAF, 0x98, 0x9C, 0x6C, 0x60,
0x78, 0x77, 0x9F, 0x6C, 0x71, 0x42, 0x78, 0x7A, 0x9E, 0x8A, 0x6C, 0x6C, 0x6A, 0xA3, 0x91, 0xB1, 0x6C, 0x7C, 0x71, 0x9C,
0xA8, 0x96, 0x83, 0x52, 0x7A, 0x70, 0xA3, 0x75, 0x77, 0x49, 0x63, 0x7E, 0x8C, 0xA1, 0x69, 0x77, 0x5C, 0x9E, 0x93, 0xAF,
0x81, 0x71, 0x7A, 0x87, 0xB1, 0x8F, 0x9A, 0x50, 0x78, 0x69, 0x96, 0x8A, 0x71, 0x5E, 0x49, 0x83, 0x78, 0xAA, 0x70, 0x78,
0x5A, 0x88, 0x98, 0xA1, 0x9E, 0x69, 0x81, 0x71, 0xAF, 0x98, 0x9F, 0x63, 0x67, 0x71, 0x83, 0x98, 0x71, 0x6E, 0x43, 0x7C,
0x73, 0xA5, 0x85, 0x73, 0x67, 0x70, 0x9F, 0x9A, 0xAD, 0x6A, 0x80, 0x6C, 0xA3, 0x9E, 0x9E, 0x7C, 0x59, 0x77, 0x6E, 0xA1,
0x77, 0x77, 0x43, 0x69, 0x75, 0x95, 0x95, 0x6E, 0x71, 0x61, 0x9E, 0x8F, 0xB3, 0x7A, 0x7C, 0x71, 0x8E, 0xA6, 0x98, 0x91,
0x55, 0x78, 0x67, 0x9E, 0x7E, 0x7C, 0x53, 0x59, 0x7A, 0x7C, 0xA5, 0x70, 0x7E, 0x59, 0x93, 0x91, 0xAD, 0x91, 0x6E, 0x80,
0x77, 0xB1, 0x8F, 0xA1, 0x5E, 0x70, 0x6A, 0x85, 0x93, 0x73, 0x69, 0x45, 0x7A, 0x73, 0xA6, 0x7C, 0x78, 0x65, 0x7A, 0x9A,
0x9C, 0xA6, 0x70, 0x81, 0x71, 0xA5, 0x9A, 0xA1, 0x71, 0x63, 0x70, 0x78, 0x9A, 0x73, 0x77, 0x47, 0x71, 0x70, 0x9C, 0x88,
0x77, 0x6C, 0x6C, 0x9C, 0x93, 0xB3, 0x71, 0x83, 0x6C, 0x98, 0x9F, 0x9A, 0x87, 0x5A, 0x7A, 0x67, 0x9E, 0x77, 0x80, 0x4E,
0x63, 0x75, 0x85, 0x9E, 0x6C, 0x7C, 0x5A, 0x9A, 0x8C, 0xB1, 0x87, 0x78, 0x7A, 0x7E, 0xAC, 0x8E, 0x9F, 0x5A, 0x75, 0x67,
0x8E, 0x88, 0x77, 0x65, 0x4C, 0x7A, 0x73, 0xA1, 0x77, 0x7E, 0x63, 0x85, 0x95, 0x9F, 0x9E, 0x73, 0x83, 0x73, 0xA5, 0x93,
0x9E, 0x6C, 0x6E, 0x6E, 0x7E, 0x8F, 0x75, 0x73, 0x4B, 0x75, 0x6A, 0x9C, 0x80, 0x7E, 0x69, 0x77, 0x96, 0x93, 0xAC, 0x73,
0x8A, 0x6A, 0x9F, 0x93, 0x9C, 0x7E, 0x65, 0x78, 0x69, 0x9C, 0x70, 0x81, 0x4B, 0x6E, 0x6C, 0x8A, 0x93, 0x71, 0x7E, 0x60,
0x9E, 0x88, 0xAF, 0x81, 0x83, 0x78, 0x87, 0xA3, 0x8E, 0x95, 0x60, 0x7C, 0x67, 0x91, 0x7C, 0x7A, 0x60, 0x59, 0x75, 0x78,
0x9A, 0x73, 0x80, 0x65, 0x8C, 0x8E, 0xA3, 0x8F, 0x80, 0x80, 0x7C, 0xA1, 0x8E, 0x9C, 0x67, 0x78, 0x67, 0x87, 0x85, 0x77,
0x6C, 0x53, 0x78, 0x6C, 0x9C, 0x75, 0x83, 0x65, 0x80, 0x91, 0x98, 0xA3, 0x75, 0x8E, 0x6C, 0xA5, 0x8A, 0xA1, 0x77, 0x6E,
0x73, 0x71, 0x93, 0x6C, 0x7E, 0x4C, 0x73, 0x69, 0x91, 0x83, 0x77, 0x7A, 0x6A, 0x9C, 0x88, 0xAC, 0x7A, 0x8A, 0x77, 0x8F,
0x98, 0x91, 0x8E, 0x65, 0x7A, 0x69, 0x95, 0x73, 0x7C, 0x5A, 0x65, 0x73, 0x80, 0x8F, 0x75, 0x80, 0x67, 0x91, 0x8A, 0xA8,
0x88, 0x85, 0x7E, 0x85, 0x9F, 0x8C, 0x96, 0x65, 0x7E, 0x67, 0x8C, 0x7A, 0x7A, 0x65, 0x5A, 0x75, 0x71, 0x98, 0x6E, 0x88,
0x63, 0x8E, 0x8C, 0x9C, 0x96, 0x7A, 0x8C, 0x73, 0xA6, 0x87, 0x9F, 0x6C, 0x78, 0x70, 0x7C, 0x8E, 0x6C, 0x7A, 0x50, 0x7C,
0x6A, 0x91, 0x7A, 0x7E, 0x77, 0x77, 0x98, 0x8A, 0xA5, 0x78, 0x8E, 0x75, 0x98, 0x91, 0x91, 0x83, 0x6C, 0x7A, 0x70, 0x8E,
0x6E, 0x7A, 0x57, 0x71, 0x6E, 0x87, 0x85, 0x75, 0x80, 0x6E, 0x96, 0x8A, 0xA5, 0x7E, 0x8C, 0x7A, 0x8F, 0x96, 0x8E, 0x8F,
0x69, 0x81, 0x69, 0x95, 0x70, 0x7E, 0x5E, 0x65, 0x77, 0x78, 0x8F, 0x6E, 0x8A, 0x65, 0x96, 0x87, 0x9F, 0x8A, 0x80, 0x8A,
0x7A, 0xA6, 0x80, 0x98, 0x69, 0x80, 0x70, 0x83, 0x7E, 0x6E, 0x75, 0x57, 0x80, 0x6A, 0x93, 0x71, 0x81, 0x71, 0x81, 0x96,
0x8F, 0x9A, 0x7A, 0x8F, 0x78, 0x9F, 0x87, 0x93, 0x78, 0x73, 0x78, 0x78, 0x8C, 0x6A, 0x78, 0x59, 0x77, 0x70, 0x8E, 0x78,
0x7E, 0x7A, 0x78, 0x98, 0x8A, 0xA1, 0x78, 0x8F, 0x75, 0x98, 0x8F, 0x8F, 0x83, 0x6E, 0x80, 0x6E, 0x95, 0x67, 0x80, 0x59,
0x71, 0x75, 0x7E, 0x88, 0x6E, 0x87, 0x6A, 0x9E, 0x87, 0xA1, 0x80, 0x87, 0x83, 0x88, 0x9F, 0x80, 0x95, 0x67, 0x85, 0x6E,
0x8E, 0x75, 0x70, 0x6A, 0x5E, 0x7E, 0x73, 0x91, 0x6A, 0x85, 0x6E, 0x8F, 0x93, 0x93, 0x91, 0x7A, 0x8C, 0x7E, 0xA3, 0x83,
0x91, 0x70, 0x7C, 0x75, 0x83, 0x83, 0x69, 0x73, 0x57, 0x7E, 0x71, 0x8C, 0x71, 0x7E, 0x71, 0x83, 0x98, 0x8F, 0x9C, 0x77,
0x8F, 0x77, 0xA5, 0x88, 0x8F, 0x7A, 0x70, 0x7E, 0x78, 0x91, 0x67, 0x7C, 0x55, 0x78, 0x71, 0x87, 0x7C, 0x71, 0x7E, 0x70,
0xA1, 0x88, 0xA3, 0x7A, 0x8C, 0x7C, 0x95, 0x98, 0x83, 0x8A, 0x65, 0x85, 0x70, 0x95, 0x6E, 0x75, 0x63, 0x65, 0x7C, 0x7A,
0x8A, 0x6A, 0x81, 0x6C, 0x9A, 0x8E, 0x9A, 0x87, 0x81, 0x88, 0x85, 0xA5, 0x81, 0x8E, 0x69, 0x7C, 0x73, 0x8E, 0x7C, 0x70,
0x6A, 0x5C, 0x7E, 0x75, 0x8F, 0x6A, 0x81, 0x6C, 0x8E, 0x96, 0x95, 0x93, 0x78, 0x8C, 0x78, 0xA6, 0x85, 0x91, 0x6C, 0x75,
0x78, 0x81, 0x8E, 0x67, 0x77, 0x52, 0x7E, 0x71, 0x91, 0x75, 0x78, 0x77, 0x78, 0xA1, 0x8C, 0xA3, 0x75, 0x8E, 0x7A, 0x9C,
0x93, 0x87, 0x81, 0x67, 0x81, 0x73, 0x95, 0x6C, 0x78, 0x5A, 0x70, 0x78, 0x81, 0x87, 0x6C, 0x7E, 0x6E, 0x9E, 0x8E, 0x9E,
0x81, 0x85, 0x81, 0x8E, 0x9E, 0x85, 0x8C, 0x65, 0x80, 0x71, 0x93, 0x77, 0x75, 0x65, 0x63, 0x7A, 0x78, 0x8F, 0x69, 0x81,
0x69, 0x95, 0x91, 0x9C, 0x8E, 0x7C, 0x88, 0x80, 0xA6, 0x83, 0x93, 0x69, 0x7A, 0x73, 0x88, 0x85, 0x6C, 0x75, 0x55, 0x7E,
0x71, 0x93, 0x70, 0x7C, 0x71, 0x83, 0x9A, 0x91, 0x9E, 0x77, 0x8E, 0x77, 0xA1, 0x8C, 0x8E, 0x75, 0x6C, 0x7C, 0x78, 0x8F,
0x6A, 0x78, 0x57, 0x77, 0x75, 0x88, 0x7E, 0x73, 0x7C, 0x73, 0x9E, 0x8C, 0xA1, 0x7A, 0x8A, 0x7E, 0x96, 0x95, 0x88, 0x85,
0x67, 0x81, 0x71, 0x95, 0x6E, 0x7A, 0x5C, 0x6A, 0x7A, 0x80, 0x8A, 0x6C, 0x81, 0x6A, 0x9C, 0x8E, 0x9F, 0x85, 0x81, 0x87,
0x87, 0xA3, 0x80, 0x8F, 0x65, 0x7E, 0x70, 0x8C, 0x7E, 0x70, 0x6C, 0x5C, 0x80, 0x73, 0x93, 0x6E, 0x7E, 0x6C, 0x88, 0x96,
0x95, 0x96, 0x78, 0x8C, 0x7C, 0xA3, 0x85, 0x8E, 0x6E, 0x73, 0x78, 0x7E, 0x8A, 0x6E, 0x75, 0x57, 0x7C, 0x75, 0x8F, 0x77,
0x78, 0x73, 0x7E, 0x9A, 0x8F, 0x9E, 0x77, 0x8E, 0x78, 0x9E, 0x8E, 0x8E, 0x78, 0x6C, 0x7E, 0x75, 0x93, 0x6C, 0x7A, 0x59,
0x75, 0x73, 0x83, 0x85, 0x71, 0x7E, 0x6E, 0x9E, 0x88, 0xA5, 0x7E, 0x87, 0x80, 0x8C, 0x9C, 0x81, 0x8A, 0x63, 0x83, 0x70,
0x8F, 0x77, 0x75, 0x67, 0x65, 0x7E, 0x78, 0x8F, 0x6A, 0x81, 0x6E, 0x93, 0x8F, 0x96, 0x8E, 0x7E, 0x8A, 0x83, 0x9F, 0x85,
0x8F, 0x69, 0x78, 0x77, 0x83, 0x81, 0x70, 0x71, 0x5C, 0x7E, 0x70, 0x8E, 0x70, 0x80, 0x70, 0x87, 0x93, 0x91, 0x9A, 0x78,
0x8E, 0x7C, 0x9E, 0x87, 0x8E, 0x73, 0x75, 0x7C, 0x78, 0x8C, 0x6A, 0x7A, 0x59, 0x7E, 0x71, 0x8A, 0x7C, 0x75, 0x7C, 0x78,
0x9E, 0x8A, 0x9F, 0x78, 0x8E, 0x80, 0x93, 0x93, 0x85, 0x85, 0x67, 0x85, 0x71, 0x8F, 0x70, 0x77, 0x60, 0x71, 0x78, 0x7E,
0x87, 0x6E, 0x80, 0x70, 0x98, 0x8C, 0x9E, 0x87, 0x83, 0x88, 0x87, 0x9C, 0x80, 0x8C, 0x65, 0x83, 0x70, 0x8C, 0x77, 0x77,
0x6C, 0x69, 0x7E, 0x77, 0x85, 0x5C, 0x70, 0x61, 0x8C, 0x8A, 0x8C, 0x81, 0x67, 0x80, 0x78, 0xA6, 0x8F, 0xA3, 0x7C, 0x80,
0x7C, 0x8A, 0x96, 0x8A, 0x96, 0x6E, 0x9A, 0x73, 0x8C, 0x7A, 0x7A, 0x81, 0x8F, 0x8F, 0x81, 0x88, 0x53, 0x83, 0x71, 0x87,
0x8C, 0x6E, 0x61, 0x61, 0x6C, 0x6E, 0x9C, 0x61, 0x8C, 0x65, 0x77, 0x8E, 0x8A, 0x88, 0x93, 0x83, 0x8A, 0xAD, 0x87, 0xAC,
0x85, 0x7A, 0x93, 0x7A, 0x8C, 0x83, 0x65, 0x59, 0x69, 0x3C, 0x78, 0x4E, 0x5A, 0x6A, 0x6C, 0x7C, 0x85, 0x6A, 0x75, 0x8A,
0x81, 0xCD, 0xBC, 0xAC, 0xAD, 0x7C, 0x9C, 0xA5, 0xAF, 0x9F, 0xB3, 0x50, 0x85, 0x5A, 0x61, 0x70, 0x60, 0x5E, 0x6A, 0x59,
0x4C, 0x6E, 0x3E, 0x6C, 0x80, 0x88, 0xAD, 0x87, 0x8C, 0x80, 0x9A, 0x98, 0xDD, 0xA6, 0xB1, 0x88, 0x73, 0x96, 0x8E, 0x9E,
0x96, 0x80, 0x57, 0x7C, 0x52, 0x70, 0x6C, 0x55, 0x80, 0x6C, 0x69, 0x75, 0x6C, 0x55, 0x91, 0x7E, 0x9F, 0xA3, 0x6E, 0x80,
0x75, 0x87, 0xA8, 0xBF, 0x88, 0xA5, 0x65, 0x83, 0x96, 0x8A, 0xA1, 0x96, 0x71, 0x78, 0x8A, 0x60, 0x95, 0x6A, 0x6A, 0x93,
0x67, 0x73, 0x69, 0x52, 0x4C, 0x93, 0x61, 0xA5, 0x7A, 0x5C, 0x77, 0x71, 0x8F, 0xB4, 0xAF, 0x87, 0x9F, 0x73, 0x9F, 0xB1,
0x98, 0xB8, 0x8A, 0x88, 0x80, 0x8A, 0x5E, 0x83, 0x4C, 0x70, 0x73, 0x59, 0x63, 0x4E, 0x40, 0x61, 0x7E, 0x7C, 0x9E, 0x6A,
0x6C, 0x88, 0x83, 0xBF, 0xBD, 0xB1, 0x9A, 0x9F, 0x85, 0xBC, 0x93, 0x9E, 0x91, 0x70, 0x7E, 0x71, 0x69, 0x60, 0x61, 0x47,
0x83, 0x5C, 0x63, 0x69, 0x3E, 0x63, 0x80, 0x8F, 0x9C, 0xA1, 0x5C, 0x95, 0x88, 0x9A, 0xD2, 0x9A, 0x9C, 0x85, 0x7C, 0x7E,
0xB3, 0x70, 0x9F, 0x7C, 0x63, 0x87, 0x67, 0x63, 0x6E, 0x63, 0x69, 0x9A, 0x65, 0x73, 0x6E, 0x43, 0x8C, 0x8A, 0x95, 0x93,
0x7A, 0x49, 0x8F, 0x73, 0x9E, 0xB4, 0x7E, 0x87, 0x81, 0x78, 0x96, 0xA5, 0x77, 0x9F, 0x7E, 0x81, 0x95, 0x73, 0x75, 0x73,
0x73, 0x80, 0x91, 0x5C, 0x69, 0x43, 0x52, 0x7C, 0x7A, 0x8A, 0x71, 0x5E, 0x57, 0x8E, 0x7C, 0xBC, 0x96, 0x8A, 0x95, 0x83,
0xA3, 0xA8, 0xA5, 0x8F, 0xAA, 0x7A, 0x9F, 0x7C, 0x61, 0x71, 0x53, 0x73, 0x77, 0x6C, 0x4C, 0x55, 0x2E, 0x6C, 0x83, 0x77,
0x9C, 0x5A, 0x69, 0x7E, 0x98, 0x9E, 0xCF, 0x87, 0xA1, 0x9F, 0x85, 0xB3, 0x9E, 0x83, 0x91, 0x85, 0x6E, 0x95, 0x59, 0x53,
0x70, 0x4E, 0x83, 0x7A, 0x5E, 0x53, 0x5C, 0x40, 0x9E, 0x8A, 0x8E, 0x95, 0x61, 0x7A, 0x98, 0x9F, 0xA6, 0xB3, 0x6A, 0x9A,
0x85, 0x85, 0xA1, 0x80, 0x7C, 0x85, 0x81, 0x77, 0x93, 0x50, 0x69, 0x70, 0x6A, 0x9A, 0x75, 0x6E, 0x55, 0x69, 0x61, 0xAA,
0x7C, 0x8E, 0x6E, 0x57, 0x7C, 0x85, 0x9A, 0x98, 0x88, 0x73, 0x95, 0x83, 0x98, 0x9F, 0x77, 0x9C, 0x83, 0x98, 0x93, 0x85,
0x5E, 0x85, 0x6C, 0x8F, 0x93, 0x5E, 0x65, 0x47, 0x55, 0x7A, 0x8E, 0x6A, 0x81, 0x50, 0x63, 0x8A, 0x80, 0xA6, 0x95, 0x7A,
0x8F, 0xA3, 0x8A, 0xB6, 0x8C, 0x87, 0xAA, 0x85, 0x9F, 0x8C, 0x65, 0x57, 0x80, 0x55, 0x95, 0x70, 0x4B, 0x5A, 0x3E, 0x65,
0x8C, 0x81, 0x6A, 0x87, 0x4E, 0x88, 0x9F, 0x8E, 0xB6, 0x8C, 0x8E, 0xA3, 0xA8, 0x8A, 0xAD, 0x73, 0x85, 0x9A, 0x78, 0x95,
0x67, 0x55, 0x5E, 0x7A, 0x69, 0x95, 0x5C, 0x53, 0x5C, 0x55, 0x8C, 0x93, 0x85, 0x78, 0x7C, 0x6A, 0x9F, 0x96, 0x98, 0x9F,
0x75, 0x93, 0x91, 0x96, 0x87, 0x8F, 0x6C, 0x98, 0x87, 0x8E, 0x8E, 0x59, 0x6A, 0x70, 0x85, 0x8A, 0x8A, 0x55, 0x6A, 0x57,
0x6E, 0xA1, 0x77, 0x7E, 0x69, 0x63, 0x73, 0x98, 0x77, 0x9C, 0x80, 0x71, 0xA8, 0x8C, 0x95, 0x93, 0x81, 0x81, 0xB3, 0x85,
0xA1, 0x87, 0x52, 0x88, 0x7E, 0x88, 0x8F, 0x71, 0x42, 0x6C, 0x4B, 0x7A, 0x95, 0x5C, 0x75, 0x61, 0x69, 0x83, 0x98, 0x78,
0xA5, 0x7E, 0x8A, 0xB8, 0x8E, 0x9F, 0x93, 0x8C, 0x96, 0xB1, 0x83, 0x98, 0x65, 0x52, 0x81, 0x70, 0x83, 0x71, 0x55, 0x43,
0x67, 0x53, 0x8F, 0x7E, 0x63, 0x78, 0x69, 0x87, 0x95, 0x98, 0x8F, 0xA5, 0x83, 0xAC, 0xAA, 0x87, 0x9C, 0x78, 0x91, 0x96,
0x98, 0x78, 0x83, 0x45, 0x6C, 0x80, 0x77, 0x8C, 0x60, 0x57, 0x5C, 0x6A, 0x73, 0xA1, 0x71, 0x77, 0x81, 0x6C, 0x9F, 0x88,
0x8C, 0x8A, 0x8C, 0x7E, 0xAD, 0x81, 0x80, 0x8A, 0x6C, 0xA1, 0x96, 0x8E, 0x83, 0x75, 0x50, 0x95, 0x85, 0x88, 0x91, 0x55,
0x65, 0x6E, 0x6E, 0x85, 0x8F, 0x55, 0x75, 0x6C, 0x69, 0x96, 0x6C, 0x85, 0x85, 0x85, 0x8A, 0xB1, 0x73, 0x96, 0x8A, 0x8A,
0xB8, 0x9C, 0x91, 0x88, 0x70, 0x6E, 0xA5, 0x7E, 0x85, 0x71, 0x42, 0x69, 0x5A, 0x70, 0x7C, 0x71, 0x4E, 0x7E, 0x65, 0x81,
0x93, 0x75, 0x9C, 0x8C, 0x9E, 0xA3, 0xA8, 0x80, 0xA5, 0x8C, 0xAA, 0xB1, 0x83, 0x88, 0x67, 0x5C, 0x78, 0x88, 0x69, 0x75,
0x4B, 0x45, 0x70, 0x53, 0x88, 0x78, 0x6E, 0x69, 0x8A, 0x6C, 0xA3, 0x88, 0x8A, 0xAC, 0x8F, 0xA6, 0xA6, 0x87, 0x7E, 0x98,
0x83, 0xAC, 0x93, 0x6C, 0x7E, 0x50, 0x6E, 0x88, 0x87, 0x70, 0x78, 0x43, 0x6E, 0x7A, 0x6A, 0x9C, 0x75, 0x73, 0x81, 0x88,
0x73, 0x9F, 0x70, 0x91, 0x9C, 0x83, 0xA1, 0x87, 0x71, 0x83, 0x95, 0x8F, 0xAD, 0x80, 0x71, 0x7E, 0x59, 0x93, 0x8C, 0x8C,
0x73, 0x70, 0x4C, 0x81, 0x67, 0x78, 0x87, 0x5E, 0x71, 0x75, 0x6E, 0x78, 0x85, 0x6C, 0x9E, 0x91, 0x8C, 0xAA, 0x77, 0x87,
0x93, 0xA3, 0xAA, 0xAF, 0x75, 0x87, 0x71, 0x6E, 0x9F, 0x7C, 0x7E, 0x63, 0x55, 0x50, 0x77, 0x55, 0x80, 0x70, 0x59, 0x83,
0x71, 0x7A, 0x87, 0x80, 0x8C, 0xB6, 0x93, 0xA5, 0xA3, 0x6E, 0xA1, 0x98, 0xAA, 0xA8, 0x91, 0x5E, 0x7E, 0x55, 0x77, 0x8E,
0x65, 0x71, 0x53, 0x50, 0x65, 0x70, 0x61, 0x8E, 0x6C, 0x71, 0x93, 0x6E, 0x8E, 0x88, 0x8C, 0x9F, 0xB3, 0x8A, 0xA6, 0x7E,
0x6E, 0x9C, 0x87, 0xA3, 0x8F, 0x73, 0x5E, 0x75, 0x5C, 0x93, 0x88, 0x6E, 0x78, 0x57, 0x6C, 0x78, 0x78, 0x7E, 0x8F, 0x70,
0x8A, 0x88, 0x6C, 0x8F, 0x6E, 0x8F, 0x9A, 0x96, 0x81, 0x95, 0x60, 0x87, 0x9C, 0x93, 0xB3, 0x83, 0x71, 0x75, 0x77, 0x7A,
0xA6, 0x7A, 0x78, 0x75, 0x52, 0x7A, 0x6A, 0x6C, 0x78, 0x77, 0x60, 0x88, 0x61, 0x6A, 0x81, 0x6A, 0xA6, 0x9C, 0x91, 0x8F,
0x8C, 0x6C, 0xAA, 0x9F, 0xA6, 0xB6, 0x71, 0x80, 0x7A, 0x75, 0x88, 0x96, 0x63, 0x77, 0x5C, 0x4B, 0x75, 0x55, 0x71, 0x77,
0x71, 0x71, 0x8C, 0x63, 0x83, 0x85, 0x85, 0xBD, 0x9C, 0x9E, 0x91, 0x7E, 0x83, 0xB3, 0x9A, 0xAC, 0x93, 0x5C, 0x78, 0x60,
0x73, 0x87, 0x7A, 0x5C, 0x71, 0x50, 0x65, 0x75, 0x5E, 0x87, 0x7A, 0x80, 0x85, 0x81, 0x69, 0x8F, 0x80, 0xA3, 0xB8, 0x8A,
0x9A, 0x75, 0x73, 0x8A, 0xA5, 0x8C, 0xA3, 0x6A, 0x63, 0x7C, 0x5E, 0x8E, 0x88, 0x77, 0x73, 0x73, 0x57, 0x7E, 0x6C, 0x6C,
0x98, 0x75, 0x8E, 0x80, 0x70, 0x6E, 0x8A, 0x7A, 0xAD, 0x9E, 0x7E, 0x8F, 0x63, 0x81, 0x9A, 0xA1, 0x9E, 0x9F, 0x65, 0x7E,
0x7A, 0x70, 0x9F, 0x80, 0x7C, 0x7A, 0x65, 0x5C, 0x78, 0x57, 0x75, 0x85, 0x63, 0x8A, 0x63, 0x63, 0x6C, 0x83, 0x88, 0xB8,
0x8C, 0x8E, 0x87, 0x6A, 0x9F, 0xA3, 0xA8, 0xA6, 0x8C, 0x69, 0x87, 0x70, 0x7C, 0x96, 0x65, 0x81, 0x63, 0x59, 0x5C, 0x67,
0x55, 0x88, 0x78, 0x7A, 0x8F, 0x5C, 0x7A, 0x83, 0x95, 0xAC, 0xB8, 0x87, 0x96, 0x7C, 0x7E, 0xAC, 0x98, 0xA5, 0x93, 0x70,
0x67, 0x73, 0x60, 0x81, 0x7C, 0x61, 0x85, 0x52, 0x63, 0x63, 0x67, 0x70, 0x9C, 0x77, 0x8F, 0x80, 0x61, 0x8A, 0x87, 0x9E,
0xB3, 0x9C, 0x80, 0x88, 0x67, 0x85, 0x9F, 0x85, 0xA6, 0x77, 0x6C, 0x70, 0x71, 0x6E, 0x98, 0x75, 0x81, 0x85, 0x57, 0x77,
0x67, 0x71, 0x88, 0x95, 0x7A, 0x93, 0x60, 0x67, 0x88, 0x7A, 0xA6, 0x9E, 0x83, 0x7C, 0x7A, 0x6A, 0x9F, 0x9A, 0x8F, 0xAC,
0x6C, 0x83, 0x73, 0x75, 0x80, 0x95, 0x70, 0x8F, 0x6E, 0x55, 0x71, 0x55, 0x73, 0x88, 0x7E, 0x7C, 0x75, 0x52, 0x71, 0x85,
0x83, 0xB6, 0x8E, 0x8C, 0x83, 0x7A, 0x83, 0xAC, 0x91, 0xA6, 0x98, 0x6C, 0x85, 0x69, 0x77, 0x85, 0x83, 0x71, 0x88, 0x52,
0x5E, 0x65, 0x59, 0x8A, 0x87, 0x85, 0x87, 0x70, 0x60, 0x8E, 0x88, 0xA1, 0xB8, 0x80, 0x96, 0x73, 0x80, 0x8E, 0xA3, 0x87,
0xA6, 0x75, 0x70, 0x7C, 0x5A, 0x7E, 0x7C, 0x78, 0x87, 0x7E, 0x52, 0x6E, 0x67, 0x6E, 0xA5, 0x7E, 0x91, 0x77, 0x60, 0x70,
0x8F, 0x83, 0xA8, 0x98, 0x77, 0x8C, 0x61, 0x83, 0x8F, 0x8C, 0x8F, 0x9E, 0x71, 0x7E, 0x73, 0x69, 0x95, 0x81, 0x8F, 0x8F,
0x6A, 0x5C, 0x71, 0x63, 0x88, 0x96, 0x73, 0x8A, 0x5C, 0x60, 0x75, 0x87, 0x87, 0xAC, 0x7E, 0x87, 0x81, 0x6A, 0x9C, 0x93,
0x9A, 0xA6, 0x98, 0x75, 0x88, 0x69, 0x7C, 0x98, 0x7A, 0x9C, 0x73, 0x5C, 0x59, 0x63, 0x60, 0x8F, 0x7A, 0x73, 0x7A, 0x45,
0x73, 0x7C, 0x8A, 0x9C, 0xA3, 0x80, 0x95, 0x7C, 0x7C, 0xA8, 0x88, 0xA8, 0xA1, 0x83, 0x7A, 0x77, 0x5E, 0x85, 0x83, 0x77,
0x93, 0x55, 0x52, 0x59, 0x60, 0x78, 0x98, 0x77, 0x88, 0x70, 0x5A, 0x8E, 0x88, 0x9E, 0xAA, 0x98, 0x88, 0x93, 0x6E, 0x8F,
0x98, 0x85, 0xAC, 0x8A, 0x78, 0x6C, 0x63, 0x63, 0x8E, 0x78, 0x8E, 0x80, 0x4C, 0x69, 0x5C, 0x78, 0x8F, 0x91, 0x7C, 0x8A,
0x5C, 0x6E, 0x91, 0x7A, 0xA6, 0x91, 0x8C, 0x85, 0x7A, 0x69, 0x95, 0x83, 0x8F, 0xAC, 0x78, 0x81, 0x69, 0x65, 0x83, 0x95,
0x87, 0x9A, 0x6E, 0x52, 0x75, 0x5C, 0x8E, 0x93, 0x80, 0x7C, 0x75, 0x50, 0x80, 0x81, 0x7C, 0xA8, 0x85, 0x8E, 0x87, 0x73,
0x7C, 0x9E, 0x87, 0xAF, 0xA3, 0x7A, 0x81, 0x5E, 0x73, 0x8F, 0x8F, 0x8A, 0x8A, 0x4C, 0x55, 0x63, 0x5C, 0x93, 0x78, 0x7C,
0x71, 0x65, 0x5A, 0x8E, 0x77, 0x98, 0xA3, 0x8A, 0x9E, 0x7A, 0x78, 0x8E, 0x96, 0x96, 0xB4, 0x8C, 0x73, 0x71, 0x4E, 0x88,
0x81, 0x8A, 0x85, 0x6A, 0x47, 0x65, 0x5E, 0x7A, 0x98, 0x73, 0x8F, 0x75, 0x65, 0x7A, 0x8E, 0x83, 0xAD, 0x9A, 0x91, 0x98,
0x69, 0x7E, 0x8E, 0x8A, 0xA3, 0xA3, 0x71, 0x70, 0x5C, 0x5C, 0x96, 0x81, 0x95, 0x81, 0x61, 0x55, 0x77, 0x67, 0x96, 0x8A,
0x7C, 0x8E, 0x67, 0x6C, 0x80, 0x7C, 0x88, 0xA6, 0x85, 0x91, 0x7E, 0x57, 0x8A, 0x7C, 0x9A, 0xA8, 0x98, 0x6E, 0x75, 0x5A,
0x81, 0x9C, 0x85, 0x9F, 0x6C, 0x60, 0x60, 0x70, 0x73, 0x96, 0x77, 0x81, 0x80, 0x57, 0x77, 0x70, 0x77, 0x9A, 0x9A, 0x8F,
0x95, 0x6C, 0x71, 0x9A, 0x85, 0xBC, 0xA5, 0x8A, 0x75, 0x6E, 0x5E, 0x9C, 0x88, 0x8C, 0x8C, 0x59, 0x5C, 0x60, 0x61, 0x7A,
0x85, 0x70, 0x88, 0x6C, 0x5E, 0x81, 0x6C, 0x8F, 0xA1, 0x9F, 0x96, 0x8F, 0x5E, 0x88, 0x8F, 0x93, 0xBD, 0x8E, 0x80, 0x67,
0x60, 0x6C, 0x98, 0x78, 0x8C, 0x75, 0x4E, 0x6A, 0x5C, 0x73, 0x87, 0x85, 0x81, 0x8F, 0x6A, 0x75, 0x81, 0x70, 0xAC, 0x9C,
0xA6, 0x95, 0x78, 0x63, 0x91, 0x85, 0xA5, 0xAD, 0x75, 0x78, 0x5C, 0x61, 0x83, 0x8F, 0x80, 0x8F, 0x67, 0x5E, 0x73, 0x60,
0x85, 0x81, 0x83, 0x8A, 0x81, 0x63, 0x7A, 0x70, 0x81, 0xA8, 0x91, 0x9E, 0x7C, 0x67, 0x70, 0x8C, 0x8A, 0xB4, 0x93, 0x78,
0x7A, 0x59, 0x80, 0x8C, 0x87, 0x8A, 0x88, 0x59, 0x73, 0x69, 0x63, 0x8F, 0x73, 0x8C, 0x88, 0x71, 0x69, 0x78, 0x67, 0x9C,
0xA3, 0x93, 0xA3, 0x6C, 0x70, 0x87, 0x93, 0x9F, 0xB6, 0x7C, 0x7A, 0x70, 0x59, 0x8E, 0x83, 0x81, 0x87, 0x71, 0x59, 0x75,
0x57, 0x70, 0x8A, 0x71, 0x93, 0x80, 0x6C, 0x71, 0x7A, 0x7C, 0xAF, 0xA1, 0x9A, 0x91, 0x63, 0x7E, 0x85, 0x98, 0xA1, 0x9A,
0x6C, 0x7A, 0x5A, 0x6E, 0x88, 0x77, 0x87, 0x78, 0x69, 0x67, 0x71, 0x61, 0x88, 0x83, 0x8A, 0x9E, 0x73, 0x7C, 0x70, 0x7C,
0x93, 0xAD, 0x8F, 0x9C, 0x70, 0x63, 0x88, 0x7E, 0x9F, 0x98, 0x80, 0x6E, 0x73, 0x59, 0x87, 0x83, 0x7A, 0x96, 0x70, 0x77,
0x7A, 0x6A, 0x73, 0x91, 0x7E, 0x95, 0x8F, 0x63, 0x7E, 0x63, 0x7E, 0x9E, 0x9A, 0x83, 0x8F, 0x57, 0x71, 0x87, 0x81, 0xA5,
0x91, 0x75, 0x7E, 0x73, 0x6C, 0x96, 0x7E, 0x87, 0x93, 0x6C, 0x7E, 0x70, 0x67, 0x78, 0x8C, 0x7A, 0x9E, 0x71, 0x65, 0x73,
0x63, 0x8E, 0x9C, 0x96, 0x87, 0x87, 0x60, 0x8C, 0x8A, 0x96, 0xA6, 0x83, 0x81, 0x7A, 0x73, 0x7C, 0x8A, 0x77, 0x8F, 0x7E,
0x6C, 0x7E, 0x57, 0x71, 0x78, 0x83, 0x83, 0x8F, 0x61, 0x78, 0x69, 0x78, 0xA5, 0x96, 0x93, 0x8A, 0x71, 0x75, 0x8F, 0x81,
0x9F, 0x93, 0x73, 0x8C, 0x6A, 0x73, 0x80, 0x7A, 0x78, 0x93, 0x67, 0x7E, 0x75, 0x57, 0x83, 0x81, 0x8A, 0x96, 0x85, 0x63,
0x85, 0x67, 0x8F, 0xA8, 0x88, 0x8E, 0x7E, 0x6A, 0x83, 0x8E, 0x81, 0x9F, 0x7C, 0x73, 0x8A, 0x69, 0x7C, 0x7C, 0x7E, 0x81,
0x93, 0x6C, 0x87, 0x63, 0x69, 0x85, 0x83, 0x8F, 0x87, 0x70, 0x6A, 0x77, 0x6E, 0x9C, 0x93, 0x83, 0x88, 0x6A, 0x7A, 0x83,
0x88, 0x8F, 0x96, 0x77, 0x8A, 0x7A, 0x73, 0x85, 0x77, 0x88, 0x8A, 0x7E, 0x73, 0x7C, 0x57, 0x7E, 0x80, 0x85, 0x95, 0x73,
0x6C, 0x73, 0x70, 0x85, 0xA5, 0x81, 0x91, 0x83, 0x70, 0x95, 0x85, 0x91, 0x98, 0x8A, 0x77, 0x95, 0x69, 0x7C, 0x7C, 0x6E,
0x8F, 0x81, 0x71, 0x77, 0x6A, 0x57, 0x8C, 0x7E, 0x8A, 0x8E, 0x65, 0x77, 0x77, 0x7E, 0x95, 0x9F, 0x7A, 0x91, 0x77, 0x7A,
0x91, 0x7A, 0x8F, 0x8C, 0x7C, 0x7E, 0x88, 0x63, 0x7E, 0x73, 0x7A, 0x91, 0x78, 0x78, 0x73, 0x67, 0x73, 0x95, 0x83, 0x98,
0x7C, 0x6C, 0x80, 0x77, 0x8C, 0x96, 0x8C, 0x7C, 0x88, 0x6E, 0x8A, 0x81, 0x81, 0x93, 0x7C, 0x83, 0x83, 0x7A, 0x6E, 0x83,
0x70, 0x96, 0x8C, 0x75, 0x81, 0x67, 0x6E, 0x87, 0x8E, 0x85, 0x91, 0x61, 0x78, 0x7A, 0x73, 0x98, 0x8A, 0x7A, 0x81, 0x7A,
0x75, 0x95, 0x75, 0x85, 0x93, 0x75, 0x8E, 0x85, 0x73, 0x78, 0x85, 0x77, 0x9F, 0x78, 0x77, 0x7C, 0x60, 0x78, 0x91, 0x85,
0x85, 0x80, 0x60, 0x85, 0x7C, 0x80, 0x9A, 0x7E, 0x80, 0x85, 0x81, 0x85, 0x95, 0x75, 0x96, 0x85, 0x81, 0x8E, 0x78, 0x73,
0x78, 0x80, 0x83, 0x93, 0x6C, 0x7E, 0x6A, 0x6C, 0x85, 0x87, 0x87, 0x80, 0x70, 0x6E, 0x8A, 0x78, 0x95, 0x8C, 0x77, 0x8A,
0x78, 0x83, 0x85, 0x81, 0x78, 0x96, 0x71, 0x8F, 0x80, 0x6C, 0x7C, 0x75, 0x81, 0x93, 0x80, 0x6C, 0x81, 0x65, 0x80, 0x95,
0x7E, 0x8F, 0x75, 0x6C, 0x80, 0x88, 0x7A, 0x9C, 0x75, 0x7A, 0x8C, 0x77, 0x8A, 0x8A, 0x75, 0x85, 0x91, 0x73, 0x96, 0x77,
0x71, 0x81, 0x7E, 0x8C, 0x93, 0x77, 0x71, 0x7C, 0x67, 0x91, 0x8A, 0x7E, 0x81, 0x69, 0x73, 0x83, 0x85, 0x7E, 0x93, 0x6A,
0x87, 0x7C, 0x80, 0x87, 0x7E, 0x7C, 0x8E, 0x8A, 0x80, 0x8F, 0x6A, 0x7E, 0x80, 0x81, 0x96, 0x7E, 0x73, 0x6E, 0x73, 0x77,
0x96, 0x7C, 0x87, 0x73, 0x65, 0x87, 0x7E, 0x85, 0x8E, 0x80, 0x75, 0x91, 0x77, 0x8E, 0x8A, 0x78, 0x8E, 0x8C, 0x81, 0x8A,
0x7C, 0x69, 0x88, 0x7A, 0x8E, 0x91, 0x6C, 0x75, 0x71, 0x71, 0x8A, 0x93, 0x70, 0x88, 0x65, 0x75, 0x8C, 0x83, 0x8A, 0x8C,
0x75, 0x81, 0x8A, 0x70, 0x93, 0x78, 0x78, 0x91, 0x81, 0x81, 0x83, 0x70, 0x6E, 0x8F, 0x78, 0x98, 0x7E, 0x69, 0x77, 0x73,
0x83, 0x93, 0x8A, 0x77, 0x85, 0x63, 0x87, 0x8A, 0x7E, 0x8C, 0x7E, 0x78, 0x85, 0x81, 0x78, 0x8E, 0x73, 0x8C, 0x8E, 0x7E,
0x87, 0x75, 0x70, 0x83, 0x8C, 0x87, 0x98, 0x6C, 0x71, 0x77, 0x75, 0x91, 0x8E, 0x7C, 0x78, 0x73, 0x6A, 0x8F, 0x7A, 0x8A,
0x87, 0x73, 0x81, 0x83, 0x78, 0x81, 0x83, 0x73, 0x9A, 0x81, 0x83, 0x81, 0x6A, 0x7A, 0x8C, 0x88, 0x8C, 0x88, 0x5E, 0x7C,
0x71, 0x81, 0x9A, 0x80, 0x7C, 0x7A, 0x71, 0x78, 0x93, 0x73, 0x93, 0x7E, 0x7A, 0x8C, 0x7E, 0x78, 0x85, 0x7E, 0x81, 0x9C,
0x78, 0x85, 0x75, 0x67, 0x8A, 0x8A, 0x8C, 0x8A, 0x7A, 0x63, 0x81, 0x70, 0x91, 0x8F, 0x7A, 0x7C, 0x75, 0x71, 0x85, 0x87,
0x7A, 0x8E, 0x77, 0x85, 0x85, 0x73, 0x7C, 0x7E, 0x7C, 0x8E, 0x8E, 0x77, 0x83, 0x63, 0x7A, 0x8E, 0x88, 0x91, 0x80, 0x6A,
0x70, 0x80, 0x78, 0x9F, 0x7A, 0x80, 0x7C, 0x73, 0x7C, 0x87, 0x7C, 0x83, 0x88, 0x73, 0x93, 0x78, 0x71, 0x85, 0x77, 0x8F,
0x93, 0x87, 0x78, 0x80, 0x60, 0x8F, 0x8E, 0x8A, 0x91, 0x75, 0x6C, 0x7A, 0x7C, 0x83, 0x9C, 0x70, 0x81, 0x7A, 0x6E, 0x83,
0x81, 0x7A, 0x8A, 0x83, 0x7A, 0x8F, 0x6C, 0x77, 0x81, 0x7C, 0x96, 0x8E, 0x7C, 0x77, 0x71, 0x69, 0x9A, 0x85, 0x8E, 0x83,
0x6E, 0x6E, 0x7C, 0x7C, 0x8E, 0x8C, 0x73, 0x88, 0x73, 0x7C, 0x83, 0x78, 0x85, 0x87, 0x83, 0x85, 0x87, 0x65, 0x85, 0x78,
0x8F, 0x95, 0x83, 0x7A, 0x71, 0x6C, 0x80, 0x98, 0x80, 0x93, 0x77, 0x70, 0x7E, 0x78, 0x88, 0x8F, 0x7E, 0x7A, 0x88, 0x6C,
0x87, 0x7C, 0x77, 0x8F, 0x80, 0x83, 0x87, 0x71, 0x67, 0x8A, 0x75, 0x96, 0x8A, 0x7A, 0x7A, 0x70, 0x70, 0x8F, 0x8E, 0x81,
0x8C, 0x6C, 0x78, 0x80, 0x7A, 0x8F, 0x88, 0x7A, 0x83, 0x81, 0x6E, 0x88, 0x71, 0x83, 0x8A, 0x81, 0x87, 0x81, 0x6A, 0x78,
0x88, 0x7E, 0x9F, 0x7E, 0x7A, 0x77, 0x6A, 0x81, 0x95, 0x88, 0x87, 0x87, 0x69, 0x85, 0x7A, 0x83, 0x8C, 0x7C, 0x7E, 0x83,
0x7A, 0x75, 0x85, 0x71, 0x8F, 0x81, 0x83, 0x87, 0x70, 0x6E, 0x7E, 0x81, 0x88, 0x96, 0x70, 0x7C, 0x6E, 0x70, 0x8F, 0x8A,
0x83, 0x87, 0x75, 0x70, 0x88, 0x75, 0x8E, 0x88, 0x7A, 0x87, 0x85, 0x73, 0x7C, 0x7E, 0x77, 0x96, 0x7E, 0x88, 0x80, 0x6A,
0x78, 0x83, 0x85, 0x93, 0x8A, 0x6C, 0x81, 0x69, 0x80, 0x93, 0x85, 0x83, 0x85, 0x73, 0x7C, 0x85, 0x75, 0x93, 0x80, 0x80,
0x8A, 0x7A, 0x75, 0x7C, 0x78, 0x80, 0x95, 0x78, 0x8A, 0x6E, 0x6C, 0x7C, 0x83, 0x88, 0x8E, 0x7C, 0x73, 0x7C, 0x6A, 0x8E,
0x88, 0x83, 0x88, 0x7A, 0x78, 0x81, 0x7E, 0x7E, 0x93, 0x77, 0x8E, 0x85, 0x75, 0x7C, 0x77, 0x7E, 0x8E, 0x8A, 0x7C, 0x88,
0x63, 0x7A, 0x83, 0x85, 0x8F, 0x85, 0x73, 0x7C, 0x77, 0x75, 0x98, 0x80, 0x87, 0x88, 0x75, 0x83, 0x80, 0x78, 0x87, 0x8C,
0x75, 0x98, 0x75, 0x75, 0x7E, 0x78, 0x83, 0x93, 0x7E, 0x7E, 0x7C, 0x60, 0x85, 0x81, 0x87, 0x8E, 0x78, 0x73, 0x7C, 0x75,
0x7C, 0x93, 0x75, 0x8A, 0x80, 0x78, 0x81, 0x7C, 0x7E, 0x8C, 0x85, 0x80, 0x91, 0x6A, 0x7C, 0x78, 0x7C, 0x8E, 0x8A, 0x7A,
0x7E, 0x73, 0x6E, 0x8C, 0x81, 0x8C, 0x83, 0x75, 0x7C, 0x78, 0x7C, 0x87, 0x8C, 0x7A, 0x93, 0x75, 0x83, 0x80, 0x78, 0x85,
0x8C, 0x81, 0x8C, 0x81, 0x6A, 0x83, 0x73, 0x87, 0x8F, 0x7E, 0x7C, 0x78, 0x6C, 0x7C, 0x8C, 0x78, 0x91, 0x75, 0x75, 0x80,
0x75, 0x80, 0x8A, 0x80, 0x80, 0x8F, 0x70, 0x8A, 0x78, 0x7C, 0x8C, 0x88, 0x83, 0x8C, 0x73, 0x70, 0x87, 0x77, 0x8F, 0x8C,
0x77, 0x80, 0x73, 0x73, 0x87, 0x8A, 0x7C, 0x8F, 0x6E, 0x7E, 0x7C, 0x78, 0x87, 0x88, 0x7C, 0x8A, 0x85, 0x75, 0x8A, 0x75,
0x85, 0x8E, 0x87, 0x87, 0x81, 0x70, 0x78, 0x83, 0x7C, 0x96, 0x7A, 0x7A, 0x7A, 0x6E, 0x7A, 0x88, 0x80, 0x83, 0x83, 0x6A,
0x85, 0x75, 0x7E, 0x87, 0x81, 0x81, 0x8C, 0x7A, 0x7E, 0x83, 0x75, 0x93, 0x87, 0x87, 0x8A, 0x73, 0x71, 0x80, 0x80, 0x85,
0x93, 0x6E, 0x80, 0x73, 0x71, 0x87, 0x83, 0x7E, 0x88, 0x78, 0x75, 0x8A, 0x70, 0x88, 0x87, 0x7E, 0x8C, 0x87, 0x75, 0x80,
0x7C, 0x78, 0x9A, 0x81, 0x87, 0x80, 0x6C, 0x77, 0x85, 0x80, 0x8E, 0x88, 0x6C, 0x80, 0x6E, 0x7C, 0x8A, 0x80, 0x7E, 0x88,
0x73, 0x7A, 0x81, 0x6E, 0x8E, 0x83, 0x85, 0x8A, 0x7C, 0x73, 0x7E, 0x7A, 0x85, 0x98, 0x7E, 0x88, 0x75, 0x71, 0x7E, 0x85,
0x85, 0x8E, 0x7E, 0x73, 0x7E, 0x6C, 0x85, 0x81, 0x80, 0x85, 0x80, 0x77, 0x7E, 0x78, 0x78, 0x8F, 0x7E, 0x8F, 0x83, 0x77,
0x7A, 0x7C, 0x80, 0x95, 0x8F, 0x81, 0x87, 0x69, 0x7C, 0x83, 0x83, 0x8C, 0x85, 0x71, 0x78, 0x77, 0x6E, 0x8C, 0x77, 0x83,
0x85, 0x77, 0x77, 0x7E, 0x70, 0x83, 0x8E, 0x80, 0x98, 0x78, 0x75, 0x81, 0x7C, 0x88, 0x98, 0x83, 0x80, 0x81, 0x63, 0x85,
0x83, 0x83, 0x8C, 0x7E, 0x71, 0x7E, 0x73, 0x75, 0x8C, 0x78, 0x8E, 0x83, 0x77, 0x7A, 0x7E, 0x73, 0x8E, 0x8C, 0x87, 0x91,
0x70, 0x78, 0x7C, 0x81, 0x8F, 0x91, 0x80, 0x7E, 0x75, 0x6C, 0x88, 0x7A, 0x8C, 0x83, 0x7A, 0x75, 0x7A, 0x71, 0x81, 0x81,
0x7C, 0x8F, 0x78, 0x78, 0x77, 0x73, 0x80, 0x8C, 0x88, 0x8C, 0x81, 0x6A, 0x81, 0x77, 0x8C, 0x93, 0x88, 0x80, 0x7C, 0x70,
0x7E, 0x88, 0x78, 0x96, 0x7E, 0x78, 0x7C, 0x73, 0x75, 0x87, 0x78, 0x87, 0x8E, 0x70, 0x7C, 0x71, 0x71, 0x8A, 0x8E, 0x87,
0x8C, 0x78, 0x6E, 0x88, 0x7A, 0x95, 0x91, 0x87, 0x80, 0x7C, 0x6C, 0x87, 0x81, 0x7E, 0x91, 0x78, 0x7A, 0x77, 0x6C, 0x75,
0x83, 0x7C, 0x8A, 0x85, 0x6C, 0x7C, 0x6E, 0x81, 0x8E, 0x8F, 0x8C, 0x87, 0x71, 0x7A, 0x87, 0x80, 0x9A, 0x88, 0x87, 0x78,
0x77, 0x75, 0x85, 0x7C, 0x87, 0x87, 0x75, 0x7E, 0x70, 0x71, 0x80, 0x80, 0x88, 0x8F, 0x7A, 0x73, 0x7A, 0x6C, 0x91, 0x8C,
0x91, 0x88, 0x7C, 0x6C, 0x85, 0x7C, 0x88, 0x95, 0x7C, 0x87, 0x77, 0x70, 0x7E, 0x81, 0x7A, 0x8F, 0x83, 0x77, 0x80, 0x65,
0x7A, 0x80, 0x83, 0x8F, 0x88, 0x6E, 0x77, 0x75, 0x73, 0x98, 0x83, 0x8E, 0x83, 0x71, 0x73, 0x88, 0x7C, 0x91, 0x8F, 0x7C,
0x88, 0x75, 0x77, 0x81, 0x7E, 0x85, 0x91, 0x7E, 0x78, 0x78, 0x65, 0x81, 0x7C, 0x8A, 0x8C, 0x7E, 0x6A, 0x77, 0x71, 0x83,
0x93, 0x87, 0x8E, 0x7A, 0x75, 0x80, 0x85, 0x85, 0x96, 0x88, 0x81, 0x85, 0x70, 0x80, 0x78, 0x80, 0x88, 0x88, 0x7A, 0x77,
0x69, 0x6C, 0x83, 0x7A, 0x95, 0x83, 0x75, 0x70, 0x75, 0x77, 0x95, 0x8E, 0x8C, 0x8C, 0x70, 0x7E, 0x83, 0x80, 0x8C, 0x91,
0x80, 0x88, 0x7A, 0x6C, 0x83, 0x70, 0x87, 0x8E, 0x83, 0x77, 0x77, 0x61, 0x7A, 0x85, 0x83, 0x9A, 0x7C, 0x73, 0x77, 0x77,
0x80, 0x96, 0x87, 0x8C, 0x87, 0x6E, 0x85, 0x7C, 0x80, 0x8C, 0x8C, 0x81, 0x87, 0x71, 0x71, 0x80, 0x75, 0x8F, 0x8C, 0x81,
0x77, 0x71, 0x6A, 0x83, 0x83, 0x8C, 0x8E, 0x71, 0x75, 0x73, 0x77, 0x87, 0x8E, 0x85, 0x8C, 0x78, 0x77, 0x85, 0x7A, 0x8A,
0x8C, 0x8A, 0x88, 0x83, 0x6E, 0x7C, 0x78, 0x83, 0x98, 0x83, 0x81, 0x70, 0x69, 0x71, 0x85, 0x80, 0x93, 0x80, 0x6A, 0x78,
0x6E, 0x81, 0x8A, 0x8A, 0x8A, 0x8E, 0x73, 0x83, 0x83, 0x7A, 0x96, 0x8A, 0x8E, 0x88, 0x77, 0x6C, 0x7E, 0x73, 0x8A, 0x95,
0x77, 0x7C, 0x69, 0x6A, 0x7C, 0x85, 0x85, 0x8F, 0x75, 0x71, 0x7E, 0x71, 0x8A, 0x8C, 0x88, 0x8C, 0x87, 0x75, 0x85, 0x7A,
0x7E, 0x93, 0x87, 0x8C, 0x7E, 0x70, 0x71, 0x7A, 0x78, 0x95, 0x88, 0x78, 0x77, 0x65, 0x73, 0x81, 0x8A, 0x8C, 0x8A, 0x70,
0x7A, 0x77, 0x7C, 0x8E, 0x83, 0x8C, 0x87, 0x7E, 0x78, 0x81, 0x73, 0x8A, 0x8F, 0x8A, 0x91, 0x71, 0x73, 0x73, 0x7C, 0x88,
0x9A, 0x80, 0x7E, 0x70, 0x65, 0x83, 0x7E, 0x8A, 0x8A, 0x7A, 0x6E, 0x7C, 0x70, 0x81, 0x8A, 0x7E, 0x91, 0x81, 0x7A, 0x7E,
0x7A, 0x7A, 0x95, 0x8C, 0x91, 0x8C, 0x6C, 0x78, 0x77, 0x81, 0x8F, 0x91, 0x77, 0x7A, 0x67, 0x70, 0x83, 0x7E, 0x88, 0x85,
0x71, 0x73, 0x7A, 0x73, 0x88, 0x85, 0x88, 0x95, 0x80, 0x85, 0x7E, 0x7E, 0x83, 0x9A, 0x8C, 0x93, 0x78, 0x6C, 0x78, 0x75,
0x88, 0x8E, 0x81, 0x71, 0x73, 0x63, 0x7C, 0x81, 0x80, 0x8C, 0x7A, 0x7A, 0x7A, 0x78, 0x7A, 0x8E, 0x83, 0x93, 0x8E, 0x7A,
0x85, 0x73, 0x7C, 0x8C, 0x91, 0x88, 0x8C, 0x69, 0x70, 0x78, 0x78, 0x8F, 0x88, 0x7A, 0x75, 0x70, 0x70, 0x85, 0x81, 0x88,
0x8C, 0x77, 0x81, 0x78, 0x78, 0x7E, 0x87, 0x81, 0x96, 0x80, 0x7C, 0x7E, 0x70, 0x83, 0x8F, 0x8E, 0x8C, 0x80, 0x67, 0x7E,
0x78, 0x85, 0x96, 0x81, 0x7C, 0x75, 0x70, 0x77, 0x87, 0x78, 0x8A, 0x7E, 0x77, 0x80, 0x71, 0x7A, 0x7E, 0x85, 0x88, 0x95,
0x78, 0x81, 0x77, 0x7A, 0x93, 0x91, 0x91, 0x8A, 0x77, 0x70, 0x81, 0x7C, 0x8E, 0x8C, 0x73, 0x7E, 0x6C, 0x73, 0x7C, 0x7E,
0x77, 0x8A, 0x77, 0x7E, 0x7C, 0x73, 0x7E, 0x81, 0x88, 0x95, 0x8E, 0x7E, 0x85, 0x75, 0x87, 0x95, 0x8C, 0x91, 0x80, 0x6E,
0x75, 0x7C, 0x7A, 0x8F, 0x7C, 0x78, 0x77, 0x6C, 0x7A, 0x7C, 0x7A, 0x80, 0x87, 0x77, 0x88, 0x77, 0x78, 0x85, 0x81, 0x8F,
0x93, 0x83, 0x7A, 0x7C, 0x71, 0x8E, 0x8F, 0x88, 0x8C, 0x70, 0x73, 0x78, 0x7E, 0x81, 0x8E, 0x73, 0x80, 0x75, 0x73, 0x83,
0x7A, 0x80, 0x87, 0x83, 0x7E, 0x85, 0x70, 0x7C, 0x83, 0x85, 0x93, 0x87, 0x7C, 0x7A, 0x77, 0x7E, 0x93, 0x88, 0x8E, 0x81,
0x71, 0x7E, 0x7C, 0x85, 0x8A, 0x85, 0x75, 0x83, 0x6E, 0x7C, 0x7C, 0x77, 0x80, 0x80, 0x7A, 0x7E, 0x7A, 0x6E, 0x83, 0x7C,
0x88, 0x93, 0x7C, 0x80, 0x78, 0x7C, 0x8A, 0x96, 0x87, 0x8F, 0x77, 0x78, 0x81, 0x7A, 0x87, 0x83, 0x78, 0x78, 0x7C, 0x6C,
0x7E, 0x75, 0x75, 0x85, 0x7A, 0x80, 0x7E, 0x73, 0x77, 0x8A, 0x83, 0x96, 0x8C, 0x7E, 0x83, 0x7A, 0x87, 0x91, 0x8F, 0x85,
0x88, 0x70, 0x7E, 0x7C, 0x7A, 0x87, 0x7C, 0x78, 0x7A, 0x75, 0x71, 0x80, 0x73, 0x83, 0x87, 0x7E, 0x85, 0x7C, 0x77, 0x83,
0x88, 0x88, 0x96, 0x7E, 0x7E, 0x7C, 0x78, 0x8A, 0x8C, 0x85, 0x85, 0x7A, 0x70, 0x83, 0x78, 0x81, 0x85, 0x77, 0x7E, 0x7C,
0x77, 0x7A, 0x80, 0x77, 0x8C, 0x80, 0x83, 0x81, 0x71, 0x78, 0x83, 0x87, 0x8C, 0x8C, 0x75, 0x80, 0x78, 0x80, 0x91, 0x88,
0x87, 0x81, 0x7A, 0x7A, 0x88, 0x7C, 0x8A, 0x80, 0x7A, 0x83, 0x78, 0x77, 0x7C, 0x75, 0x7C, 0x8A, 0x77, 0x80, 0x75, 0x70,
0x80, 0x83, 0x88, 0x8A, 0x80, 0x77, 0x85, 0x7A, 0x91, 0x91, 0x85, 0x8A, 0x80, 0x7A, 0x81, 0x83, 0x7C, 0x88, 0x73, 0x7E,
0x7C, 0x71, 0x75, 0x77, 0x77, 0x81, 0x81, 0x78, 0x83, 0x70, 0x7A, 0x88, 0x87, 0x91, 0x8A, 0x83, 0x80, 0x87, 0x80, 0x98,
0x87, 0x85, 0x85, 0x78, 0x7C, 0x80, 0x7A, 0x7C, 0x80, 0x73, 0x81, 0x73, 0x71, 0x7C, 0x75, 0x80, 0x88, 0x81, 0x7E, 0x81,
0x71, 0x87, 0x88, 0x88, 0x8F, 0x80, 0x7C, 0x7E, 0x80, 0x83, 0x8F, 0x7A, 0x88, 0x7C, 0x7A, 0x81, 0x7E, 0x7A, 0x81, 0x7C,
0x7C, 0x85, 0x73, 0x7A, 0x7C, 0x78, 0x88, 0x85, 0x7E, 0x7E, 0x77, 0x71, 0x8C, 0x80, 0x8A, 0x85, 0x7A, 0x7E, 0x80, 0x81,
0x8E, 0x8A, 0x7E, 0x8C, 0x7C, 0x81, 0x85, 0x7A, 0x83, 0x81, 0x7E, 0x81, 0x81, 0x6C, 0x7C, 0x75, 0x7E, 0x87, 0x7A, 0x7C,
0x78, 0x71, 0x7C, 0x8C, 0x80, 0x8E, 0x7E, 0x7E, 0x83, 0x83, 0x88, 0x8F, 0x83, 0x83, 0x8A, 0x7C, 0x85, 0x7C, 0x77, 0x81,
0x7C, 0x7E, 0x7E, 0x75, 0x6C, 0x7C, 0x71, 0x87, 0x80, 0x7A, 0x7C, 0x78, 0x78, 0x8A, 0x8A, 0x87, 0x8F, 0x7C, 0x87, 0x87,
0x83, 0x8E, 0x88, 0x80, 0x85, 0x83, 0x78, 0x83, 0x73, 0x7E, 0x80, 0x78, 0x80, 0x7A, 0x70, 0x75, 0x7C, 0x78, 0x8E, 0x7C,
0x80, 0x7E, 0x77, 0x81, 0x8E, 0x85, 0x87, 0x87, 0x7A, 0x88, 0x80, 0x81, 0x8A, 0x7C, 0x81, 0x85, 0x80, 0x7A, 0x81, 0x73,
0x85, 0x7E, 0x7E, 0x81, 0x77, 0x75, 0x7C, 0x7C, 0x81, 0x88, 0x75, 0x7E, 0x77, 0x77, 0x87, 0x85, 0x81, 0x85, 0x7E, 0x7E,
0x88, 0x7C, 0x8A, 0x85, 0x80, 0x88, 0x87, 0x81, 0x81, 0x7E, 0x7C, 0x8A, 0x7A, 0x85, 0x7A, 0x70, 0x75, 0x7A, 0x7A, 0x83,
0x7E, 0x71, 0x80, 0x71, 0x80, 0x88, 0x81, 0x85, 0x81, 0x80, 0x87, 0x8A, 0x80, 0x91, 0x81, 0x85, 0x8A, 0x83, 0x80, 0x7E,
0x78, 0x80, 0x83, 0x77, 0x81, 0x70, 0x6E, 0x78, 0x78, 0x80, 0x83, 0x78, 0x78, 0x81, 0x77, 0x8C, 0x87, 0x83, 0x88, 0x83,
0x85, 0x8C, 0x85, 0x83, 0x8C, 0x7C, 0x8A, 0x83, 0x7C, 0x7C, 0x78, 0x78, 0x81, 0x7C, 0x78, 0x81, 0x6C, 0x78, 0x7C, 0x7E,
0x85, 0x80, 0x7A, 0x7E, 0x7E, 0x7E, 0x8E, 0x7E, 0x87, 0x81, 0x7E, 0x87, 0x85, 0x7E, 0x85, 0x83, 0x7C, 0x8C, 0x7C, 0x80,
0x7C, 0x78, 0x80, 0x85, 0x7E, 0x80, 0x7C, 0x70, 0x81, 0x7C, 0x83, 0x83, 0x78, 0x78, 0x80, 0x78, 0x81, 0x88, 0x7A, 0x85,
0x7E, 0x81, 0x8A, 0x81, 0x83, 0x88, 0x83, 0x85, 0x8E, 0x7A, 0x85, 0x7E, 0x7E, 0x87, 0x83, 0x78, 0x7E, 0x73, 0x71, 0x80,
0x75, 0x80, 0x78, 0x73, 0x7A, 0x7E, 0x7E, 0x88, 0x83, 0x7C, 0x88, 0x80, 0x8C, 0x88, 0x83, 0x88, 0x87, 0x83, 0x8A, 0x87,
0x78, 0x83, 0x75, 0x81, 0x81, 0x78, 0x77, 0x77, 0x6C, 0x7A, 0x80, 0x78, 0x85, 0x75, 0x78, 0x80, 0x80, 0x87, 0x88, 0x80,
0x85, 0x88, 0x80, 0x91, 0x83, 0x85, 0x87, 0x83, 0x83, 0x87, 0x7C, 0x78, 0x7E, 0x77, 0x85, 0x7E, 0x78, 0x7A, 0x75, 0x77,
0x83, 0x7E, 0x80, 0x83, 0x73, 0x81, 0x81, 0x81, 0x88, 0x83, 0x7C, 0x87, 0x81, 0x81, 0x8A, 0x78, 0x87, 0x81, 0x83, 0x85,
0x83, 0x77, 0x81, 0x7C, 0x80, 0x8C, 0x7A, 0x7C, 0x7A, 0x75, 0x7E, 0x83, 0x7C, 0x7E, 0x7C, 0x70, 0x83, 0x78, 0x83, 0x83,
0x7C, 0x7C, 0x87, 0x7E, 0x87, 0x88, 0x7E, 0x8C, 0x87, 0x87, 0x88, 0x81, 0x7E, 0x83, 0x80, 0x85, 0x87, 0x75, 0x7A, 0x71,
0x77, 0x7E, 0x7C, 0x78, 0x7A, 0x73, 0x77, 0x81, 0x78, 0x88, 0x80, 0x83, 0x85, 0x87, 0x85, 0x8C, 0x81, 0x87, 0x8E, 0x83,
0x8A, 0x83, 0x7A, 0x80, 0x7E, 0x7E, 0x85, 0x7C, 0x71, 0x7A, 0x6C, 0x7E, 0x7E, 0x7A, 0x7E, 0x7C, 0x77, 0x81, 0x81, 0x7E,
0x8C, 0x7E, 0x87, 0x8A, 0x83, 0x87, 0x88, 0x7E, 0x88, 0x8A, 0x80, 0x88, 0x78, 0x78, 0x80, 0x7C, 0x80, 0x85, 0x75, 0x77,
0x7A, 0x71, 0x87, 0x7E, 0x80, 0x7E, 0x7A, 0x78, 0x87, 0x7E, 0x83, 0x87, 0x7C, 0x88, 0x81, 0x80, 0x85, 0x81, 0x7E, 0x8A,
0x85, 0x81, 0x85, 0x75, 0x81, 0x81, 0x81, 0x85, 0x81, 0x75, 0x7A, 0x78, 0x7C, 0x87, 0x78, 0x7E, 0x78, 0x77, 0x7A, 0x81,
0x7A, 0x81, 0x81, 0x7E, 0x88, 0x7E, 0x85, 0x83, 0x81, 0x8A, 0x8E, 0x85, 0x87, 0x80, 0x7A, 0x88, 0x80, 0x87, 0x81, 0x78,
0x75, 0x78, 0x73, 0x7E, 0x7C, 0x75, 0x80, 0x75, 0x78, 0x80, 0x7C, 0x7E, 0x87, 0x80, 0x88, 0x8A, 0x7A, 0x8A, 0x83, 0x88,
0x8E, 0x8A, 0x81, 0x87, 0x77, 0x7C, 0x85, 0x7A, 0x85, 0x7A, 0x73, 0x77, 0x77, 0x75, 0x83, 0x7A, 0x7A, 0x81, 0x75, 0x80,
0x81, 0x80, 0x83, 0x88, 0x81, 0x8C, 0x83, 0x7E, 0x87, 0x7E, 0x8A, 0x8A, 0x85, 0x7E, 0x7E, 0x77, 0x80, 0x83, 0x7E, 0x85,
0x75, 0x7A, 0x77, 0x78, 0x7E, 0x83, 0x7A, 0x80, 0x7E, 0x77, 0x81, 0x7A, 0x81, 0x83, 0x83, 0x85, 0x87, 0x78, 0x80, 0x81,
0x80, 0x8E, 0x83, 0x83, 0x81, 0x7A, 0x7E, 0x88, 0x80, 0x83, 0x83, 0x75, 0x7E, 0x75, 0x78, 0x80, 0x7E, 0x77, 0x83, 0x75,
0x77, 0x7E, 0x73, 0x83, 0x81, 0x81, 0x85, 0x85, 0x7A, 0x87, 0x83, 0x88, 0x93, 0x83, 0x87, 0x81, 0x7C, 0x83, 0x8A, 0x7E,
0x87, 0x7C, 0x73, 0x7C, 0x73, 0x78, 0x7C, 0x78, 0x78, 0x81, 0x73, 0x7C, 0x7C, 0x78, 0x88, 0x85, 0x88, 0x88, 0x81, 0x80,
0x88, 0x83, 0x8E, 0x8C, 0x80, 0x85, 0x7A, 0x7C, 0x81, 0x80, 0x7A, 0x81, 0x73, 0x78, 0x77, 0x71, 0x7E, 0x7A, 0x7C, 0x81,
0x7C, 0x78, 0x7E, 0x7C, 0x83, 0x8C, 0x83, 0x8C, 0x81, 0x7E, 0x80, 0x85, 0x83, 0x8F, 0x83, 0x81, 0x80, 0x77, 0x81, 0x80,
0x80, 0x81, 0x80, 0x77, 0x7E, 0x75, 0x78, 0x81, 0x7A, 0x83, 0x81, 0x7A, 0x7A, 0x7E, 0x7A, 0x88, 0x85, 0x80, 0x8A, 0x78,
0x7C, 0x81, 0x83, 0x87, 0x8E, 0x7E, 0x85, 0x7E, 0x7A, 0x85, 0x81, 0x81, 0x83, 0x7E, 0x7A, 0x7E, 0x73, 0x7A, 0x80, 0x78,
0x83, 0x7C, 0x75, 0x78, 0x78, 0x7A, 0x8A, 0x81, 0x85, 0x85, 0x78, 0x83, 0x87, 0x8A, 0x8C, 0x8C, 0x81, 0x87, 0x7A, 0x7E,
0x85, 0x7E, 0x83, 0x81, 0x7A, 0x78, 0x75, 0x71, 0x7C, 0x7A, 0x7C, 0x81, 0x75, 0x7A, 0x78, 0x7C, 0x85, 0x8A, 0x81, 0x8C,
0x7E, 0x80, 0x88, 0x83, 0x8C, 0x8A, 0x85, 0x83, 0x83, 0x77, 0x83, 0x7E, 0x7C, 0x85, 0x78, 0x7A, 0x77, 0x73, 0x73, 0x81,
0x7A, 0x85, 0x80, 0x77, 0x7C, 0x78, 0x83, 0x8A, 0x88, 0x83, 0x8A, 0x77, 0x80, 0x83, 0x83, 0x8A, 0x85, 0x80, 0x83, 0x7E,
0x77, 0x85, 0x7E, 0x81, 0x88, 0x7C, 0x7E, 0x77, 0x75, 0x7C, 0x83, 0x7C, 0x8A, 0x78, 0x77, 0x7A, 0x78, 0x83, 0x88, 0x83,
0x81, 0x81, 0x78, 0x83, 0x81, 0x83, 0x8A, 0x83, 0x87, 0x81, 0x7E, 0x7E, 0x85, 0x7C, 0x88, 0x81, 0x7C, 0x7A, 0x70, 0x77,
0x7C, 0x7E, 0x7E, 0x80, 0x71, 0x78, 0x75, 0x7C, 0x87, 0x83, 0x85, 0x85, 0x80, 0x80, 0x8A, 0x83, 0x8A, 0x8C, 0x83, 0x8C,
0x80, 0x7E, 0x80, 0x80, 0x7E, 0x88, 0x78, 0x7C, 0x75, 0x6E, 0x7A, 0x7E, 0x7C, 0x81, 0x7C, 0x73, 0x7E, 0x77, 0x83, 0x8C,
0x83, 0x88, 0x87, 0x7E, 0x85, 0x87, 0x80, 0x8E, 0x83, 0x85, 0x87, 0x7A, 0x7A, 0x7E, 0x7E, 0x80, 0x85, 0x75, 0x7C, 0x71,
0x71, 0x80, 0x7E, 0x81, 0x83, 0x7A, 0x78, 0x7E, 0x7A, 0x88, 0x85, 0x81, 0x88, 0x80, 0x7E, 0x83, 0x81, 0x81, 0x8C, 0x81,
0x87, 0x80, 0x77, 0x7E, 0x7E, 0x81, 0x87, 0x83, 0x7A, 0x7C, 0x71, 0x7E, 0x81, 0x80, 0x83, 0x7E, 0x77, 0x78, 0x7A, 0x7E,
0x87, 0x7E, 0x85, 0x83, 0x7C, 0x81, 0x80, 0x81, 0x88, 0x8A, 0x83, 0x8C, 0x7C, 0x7E, 0x80, 0x7E, 0x87, 0x87, 0x7C, 0x78,
0x78, 0x70, 0x80, 0x7C, 0x7E, 0x80, 0x77, 0x75, 0x78, 0x7A, 0x80, 0x87, 0x7E, 0x8C, 0x83, 0x81, 0x87, 0x81, 0x87, 0x8C,
0x88, 0x87, 0x88, 0x77, 0x80, 0x7E, 0x80, 0x88, 0x80, 0x7A, 0x77, 0x73, 0x73, 0x83, 0x7A, 0x80, 0x7E, 0x78, 0x7C, 0x7E,
0x7E, 0x87, 0x85, 0x85, 0x8C, 0x80, 0x83, 0x85, 0x80, 0x87, 0x88, 0x87, 0x85, 0x80, 0x75, 0x80, 0x78, 0x81, 0x83, 0x7C,
0x78, 0x77, 0x75, 0x7C, 0x81, 0x7C, 0x85, 0x7A, 0x7C, 0x7E, 0x7C, 0x81, 0x83, 0x81, 0x87, 0x88, 0x7E, 0x85, 0x7C, 0x81,
0x88, 0x85, 0x87, 0x83, 0x7A, 0x7C, 0x81, 0x7C, 0x8C, 0x81, 0x7C, 0x7C, 0x75, 0x78, 0x80, 0x7E, 0x7C, 0x81, 0x77, 0x7E,
0x7A, 0x78, 0x81, 0x80, 0x81, 0x87, 0x81, 0x7E, 0x85, 0x7A, 0x88, 0x8A, 0x87, 0x87, 0x83, 0x78, 0x81, 0x80, 0x80, 0x8A,
0x7A, 0x7A, 0x78, 0x73, 0x7C, 0x7E, 0x7A, 0x7C, 0x7C, 0x75, 0x80, 0x78, 0x7E, 0x80, 0x81, 0x87, 0x88, 0x81, 0x81, 0x85,
0x81, 0x8E, 0x88, 0x88, 0x85, 0x7A, 0x7A, 0x81, 0x80, 0x83, 0x81, 0x75, 0x7A, 0x73, 0x78, 0x7E, 0x7A, 0x7E, 0x80, 0x7C,
0x7C, 0x81, 0x78, 0x85, 0x80, 0x85, 0x8C, 0x87, 0x80, 0x83, 0x80, 0x85, 0x8C, 0x85, 0x87, 0x7E, 0x78, 0x80, 0x7E, 0x80,
0x85, 0x7E, 0x75, 0x7E, 0x73, 0x80, 0x7E, 0x7A, 0x80, 0x80, 0x7A, 0x80, 0x7E, 0x78, 0x85, 0x80, 0x87, 0x87, 0x80, 0x7E,
0x81, 0x7E, 0x88, 0x88, 0x81, 0x87, 0x7A, 0x7A, 0x81, 0x81, 0x85, 0x83, 0x7C, 0x7A, 0x7C, 0x77, 0x81, 0x7A, 0x7E, 0x7E,
0x7C, 0x7C, 0x80, 0x78, 0x7C, 0x83, 0x80, 0x88, 0x81, 0x7C, 0x80, 0x80, 0x85, 0x8C, 0x88, 0x85, 0x85, 0x77, 0x81, 0x81,
0x81, 0x85, 0x7C, 0x78, 0x7A, 0x77, 0x77, 0x7E, 0x75, 0x7E, 0x7C, 0x7A, 0x7E, 0x7C, 0x77, 0x83, 0x83, 0x87, 0x8C, 0x80,
0x83, 0x80, 0x81, 0x8C, 0x8C, 0x85, 0x83, 0x7E, 0x78, 0x83, 0x7E, 0x83, 0x81, 0x78, 0x78, 0x7C, 0x75, 0x7A, 0x7E, 0x77,
0x85, 0x7E, 0x7E, 0x80, 0x7A, 0x7E, 0x85, 0x85, 0x88, 0x8A, 0x7E, 0x83, 0x7E, 0x83, 0x8C, 0x87, 0x81, 0x80, 0x7A, 0x7C,
0x83, 0x7C, 0x85, 0x7C, 0x78, 0x7C, 0x7C, 0x78, 0x7E, 0x7C, 0x7C, 0x85, 0x7C, 0x81, 0x7C, 0x78, 0x80, 0x83, 0x85, 0x88,
0x81, 0x7C, 0x81, 0x7E, 0x8A, 0x8A, 0x83, 0x81, 0x7E, 0x7C, 0x83, 0x81, 0x81, 0x83, 0x7A, 0x80, 0x7C, 0x78, 0x7E, 0x7A,
0x7A, 0x81, 0x7E, 0x7C, 0x80, 0x77, 0x7C, 0x81, 0x83, 0x87, 0x85, 0x7C, 0x80, 0x81, 0x83, 0x8F, 0x87, 0x85, 0x81, 0x7C,
0x80, 0x83, 0x7E, 0x81, 0x80, 0x77, 0x80, 0x78, 0x78, 0x7A, 0x78, 0x7A, 0x81, 0x7C, 0x7A, 0x7E, 0x75, 0x83, 0x87, 0x88,
0x88, 0x83, 0x7C, 0x83, 0x85, 0x87, 0x8F, 0x83, 0x83, 0x7E, 0x7C, 0x80, 0x81, 0x7E, 0x81, 0x7C, 0x78, 0x80, 0x75, 0x78,
0x7A, 0x7A, 0x83, 0x81, 0x7E, 0x80, 0x7C, 0x7C, 0x87, 0x85, 0x8A, 0x83, 0x7E, 0x81, 0x81, 0x85, 0x8A, 0x88, 0x7E, 0x83,
0x7A, 0x80, 0x80, 0x80, 0x7E, 0x81, 0x7A, 0x7E, 0x7E, 0x75, 0x7E, 0x78, 0x7E, 0x83, 0x7C, 0x7C, 0x7A, 0x75, 0x7E, 0x88,
0x81, 0x88, 0x7E, 0x7E, 0x80, 0x81, 0x85, 0x8A, 0x81, 0x80, 0x83, 0x7C, 0x85, 0x81, 0x81, 0x83, 0x7E, 0x7C, 0x7E, 0x7A,
0x75, 0x7E, 0x77, 0x83, 0x80, 0x7C, 0x7C, 0x77, 0x7A, 0x83, 0x87, 0x85, 0x88, 0x78, 0x7E, 0x81, 0x85, 0x8A, 0x8A, 0x81,
0x83, 0x81, 0x7E, 0x85, 0x7E, 0x80, 0x81, 0x7A, 0x7C, 0x7A, 0x75, 0x78, 0x7C, 0x7A, 0x83, 0x7A, 0x7C, 0x78, 0x77, 0x80,
0x88, 0x87, 0x87, 0x83, 0x7C, 0x85, 0x83, 0x87, 0x8C, 0x85, 0x83, 0x81, 0x7E, 0x80, 0x83, 0x7A, 0x83, 0x7E, 0x7C, 0x7E,
0x77, 0x77, 0x7C, 0x7C, 0x81, 0x85, 0x7A, 0x80, 0x7A, 0x7C, 0x85, 0x87, 0x87, 0x87, 0x7E, 0x7E, 0x85, 0x7E, 0x8A, 0x88,
0x7E, 0x83, 0x7E, 0x7C, 0x80, 0x7E, 0x7C, 0x85, 0x7A, 0x80, 0x7C, 0x75, 0x78, 0x7C, 0x7E, 0x85, 0x81, 0x78, 0x7C, 0x77,
0x7E, 0x85, 0x85, 0x85, 0x81, 0x7A, 0x7E, 0x83, 0x81, 0x8C, 0x83, 0x83, 0x83, 0x7E, 0x7E, 0x81, 0x7E, 0x80, 0x85, 0x7C,
0x81, 0x77, 0x77, 0x7A, 0x7C, 0x81, 0x83, 0x7A, 0x78, 0x7A, 0x77, 0x85, 0x83, 0x85, 0x85, 0x7E, 0x80, 0x81, 0x83, 0x87,
0x8C, 0x80, 0x87, 0x81, 0x7E, 0x80, 0x7C, 0x7E, 0x83, 0x7E, 0x7C, 0x7E, 0x70, 0x78, 0x78, 0x7E, 0x85, 0x80, 0x7A, 0x7C,
0x77, 0x7C, 0x8A, 0x83, 0x87, 0x83, 0x7C, 0x83, 0x83, 0x83, 0x88, 0x87, 0x81, 0x87, 0x7E, 0x7E, 0x80, 0x7A, 0x81, 0x83,
0x7E, 0x7E, 0x7A, 0x70, 0x7C, 0x7E, 0x83, 0x85, 0x7E, 0x7C, 0x7E, 0x7A, 0x81, 0x88, 0x81, 0x87, 0x7E, 0x80, 0x81, 0x81,
0x83, 0x87, 0x85, 0x81, 0x85, 0x7A, 0x7E, 0x7C, 0x7E, 0x83, 0x80, 0x7E, 0x7A, 0x75, 0x75, 0x80, 0x7C, 0x85, 0x81, 0x78,
0x7C, 0x78, 0x7E, 0x85, 0x83, 0x83, 0x83, 0x7A, 0x80, 0x81, 0x81, 0x88, 0x83, 0x85, 0x87, 0x81, 0x7E, 0x83, 0x7A, 0x83,
0x85, 0x81, 0x80, 0x78, 0x73, 0x7A, 0x7E, 0x7E, 0x85, 0x7C, 0x7A, 0x7A, 0x7A, 0x80, 0x85, 0x83, 0x83, 0x85, 0x7C, 0x87,
0x80, 0x85, 0x88, 0x85, 0x85, 0x85, 0x7C, 0x7E, 0x80, 0x78, 0x85, 0x81, 0x7C, 0x7C, 0x75, 0x75, 0x7C, 0x7C, 0x80, 0x81,
0x78, 0x7C, 0x7A, 0x7C, 0x85, 0x83, 0x85, 0x85, 0x81, 0x81, 0x85, 0x7C, 0x87, 0x83, 0x85, 0x85, 0x81, 0x7C, 0x7C, 0x7A,
0x80, 0x85, 0x7E, 0x80, 0x78, 0x75, 0x7A, 0x7E, 0x80, 0x85, 0x80, 0x78, 0x80, 0x78, 0x83, 0x83, 0x85, 0x85, 0x81, 0x80,
0x81, 0x81, 0x7E, 0x87, 0x81, 0x85, 0x85, 0x7C, 0x7C, 0x7E, 0x7C, 0x85, 0x85, 0x7C, 0x81, 0x77, 0x77, 0x7E, 0x7C, 0x83,
0x81, 0x7A, 0x7A, 0x7E, 0x77, 0x83, 0x80, 0x81, 0x87, 0x81, 0x7E, 0x83, 0x80, 0x81, 0x88, 0x83, 0x88, 0x83, 0x7A, 0x7E,
0x7E, 0x80, 0x87, 0x81, 0x7C, 0x7E, 0x75, 0x7C, 0x7E, 0x7E, 0x81, 0x7E, 0x7A, 0x7C, 0x7C, 0x7C, 0x85, 0x80, 0x87, 0x85,
0x80, 0x83, 0x80, 0x81, 0x87, 0x87, 0x85, 0x87, 0x7E, 0x7C, 0x7C, 0x7C, 0x83, 0x83, 0x80, 0x7A, 0x78, 0x75, 0x7E, 0x78,
0x80, 0x80, 0x7A, 0x7E, 0x7C, 0x7C, 0x83, 0x83, 0x80, 0x88, 0x81, 0x83, 0x83, 0x7C, 0x81, 0x85, 0x85, 0x87, 0x83, 0x78,
0x7E, 0x7C, 0x80, 0x85, 0x80, 0x7E, 0x7C, 0x78, 0x7A, 0x80, 0x7A, 0x83, 0x80, 0x7C, 0x80, 0x7E, 0x7E, 0x81, 0x81, 0x83,
0x87, 0x7E, 0x83, 0x80, 0x7E, 0x83, 0x83, 0x85, 0x85, 0x80, 0x7A, 0x80, 0x7C, 0x81, 0x83, 0x80, 0x7E, 0x78, 0x78, 0x7E,
0x7E, 0x7C, 0x83, 0x7A, 0x7E, 0x7C, 0x7A, 0x80, 0x7E, 0x81, 0x85, 0x83, 0x80, 0x83, 0x7C, 0x81, 0x85, 0x85, 0x88, 0x83,
0x80, 0x7E, 0x7E, 0x7E, 0x87, 0x7E, 0x80, 0x7E, 0x77, 0x7A, 0x7C, 0x7A, 0x7E, 0x80, 0x7A, 0x81, 0x7A, 0x7C, 0x81, 0x80,
0x85, 0x87, 0x83, 0x83, 0x83, 0x7C, 0x85, 0x85, 0x85, 0x87, 0x80, 0x7C, 0x80, 0x80, 0x7E, 0x83, 0x7A, 0x80, 0x7C, 0x77,
0x7E, 0x7C, 0x7C, 0x80, 0x7E, 0x7C, 0x81, 0x7C, 0x81, 0x81, 0x80, 0x87, 0x85, 0x81, 0x80, 0x81, 0x7E, 0x87, 0x81, 0x87,
0x83, 0x7A, 0x7E, 0x7C, 0x7E, 0x83, 0x83, 0x7E, 0x80, 0x78, 0x7C, 0x7E, 0x7C, 0x7E, 0x7E, 0x80, 0x80, 0x80, 0x7C, 0x80,
0x80, 0x83, 0x88, 0x81, 0x83, 0x7E, 0x80, 0x81, 0x85, 0x81, 0x88, 0x7E, 0x7E, 0x81, 0x7E, 0x81, 0x83, 0x80, 0x7E, 0x80,
0x77, 0x80, 0x7C, 0x7A, 0x80, 0x7E, 0x80, 0x80, 0x7C, 0x7C, 0x80, 0x7E, 0x87, 0x85, 0x7E, 0x81, 0x7E, 0x81, 0x85, 0x87,
0x83, 0x87, 0x7C, 0x80, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x80, 0x7A, 0x7A, 0x80, 0x7A, 0x7E, 0x80, 0x7C, 0x80, 0x7E, 0x7C,
0x80, 0x81, 0x80, 0x88, 0x85, 0x81, 0x81, 0x7C, 0x87, 0x85, 0x85, 0x85, 0x81, 0x7C, 0x81, 0x7C, 0x80, 0x80, 0x7E, 0x7E,
0x7E, 0x7A, 0x7A, 0x7E, 0x77, 0x80, 0x7E, 0x7E, 0x81, 0x7A, 0x80, 0x7E, 0x81, 0x83, 0x88, 0x80, 0x83, 0x7E, 0x80, 0x85,
0x83, 0x83, 0x83, 0x7E, 0x7E, 0x83, 0x7E, 0x81, 0x80, 0x7C, 0x81, 0x7A, 0x7C, 0x7E, 0x7C, 0x7C, 0x83, 0x7E, 0x81, 0x80,
0x7C, 0x80, 0x7E, 0x81, 0x85, 0x83, 0x7E, 0x81, 0x7C, 0x81, 0x85, 0x80, 0x85, 0x80, 0x7E, 0x80, 0x81, 0x7E, 0x81, 0x7E,
0x7E, 0x80, 0x7A, 0x7E, 0x7E, 0x7A, 0x7C, 0x80, 0x7C, 0x81, 0x7C, 0x7A, 0x80, 0x7E, 0x83, 0x85, 0x80, 0x81, 0x81, 0x80,
0x85, 0x83, 0x81, 0x85, 0x7E, 0x80, 0x81, 0x81, 0x7E, 0x81, 0x7C, 0x80, 0x7E, 0x7A, 0x80, 0x7A, 0x7C, 0x7E, 0x80, 0x7C,
0x81, 0x7C, 0x7E, 0x81, 0x80, 0x85, 0x83, 0x80, 0x81, 0x81, 0x81, 0x87, 0x83, 0x81, 0x83, 0x7C, 0x81, 0x80, 0x80, 0x80,
0x80, 0x7C, 0x80, 0x7A, 0x7E, 0x7E, 0x78, 0x80, 0x7E, 0x7E, 0x7E, 0x7E, 0x7C, 0x81, 0x81, 0x81, 0x85, 0x7E, 0x81, 0x81,
0x80, 0x83, 0x83, 0x7E, 0x81, 0x81, 0x7E, 0x83, 0x7E, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x7A, 0x7E, 0x7E, 0x7A, 0x81, 0x7E,
0x80, 0x7E, 0x7C, 0x7E, 0x81, 0x80, 0x83, 0x83, 0x7E, 0x81, 0x7E, 0x81, 0x85, 0x83, 0x81, 0x83, 0x7E, 0x81, 0x83, 0x7C,
0x81, 0x80, 0x7E, 0x80, 0x7E, 0x7A, 0x7E, 0x7A, 0x7C, 0x81, 0x7C, 0x81, 0x7E, 0x7A, 0x80, 0x81, 0x7E, 0x85, 0x80, 0x80,
0x83, 0x7E, 0x83, 0x83, 0x80, 0x81, 0x81, 0x7E, 0x81, 0x80, 0x7C, 0x83, 0x7C, 0x80, 0x7E, 0x7C, 0x7C, 0x80, 0x7C, 0x81,
0x80, 0x7C, 0x80, 0x7C, 0x7E, 0x81, 0x83, 0x83, 0x85, 0x7E, 0x80, 0x81, 0x81, 0x85, 0x81, 0x81, 0x81, 0x80, 0x7E, 0x81,
0x7E, 0x81, 0x80, 0x7C, 0x80, 0x7C, 0x7A, 0x7E, 0x7E, 0x7C, 0x81, 0x7C, 0x7E, 0x80, 0x7C, 0x81, 0x81, 0x81, 0x81, 0x81,
0x80, 0x81, 0x81, 0x80, 0x85, 0x80, 0x83, 0x80, 0x80, 0x80, 0x80, 0x7C, 0x83, 0x7E, 0x7C, 0x81, 0x7C, 0x7E, 0x7E, 0x7C,
0x80, 0x81, 0x7C, 0x7E, 0x7E, 0x7C, 0x83, 0x80, 0x80, 0x81, 0x7E, 0x80, 0x83, 0x81, 0x83, 0x83, 0x80, 0x83, 0x80, 0x81,
0x80, 0x80, 0x7E, 0x81, 0x7C, 0x7E, 0x7E, 0x7A, 0x80, 0x7E, 0x7E, 0x80, 0x80, 0x7C, 0x80, 0x7C, 0x7E, 0x85, 0x80, 0x85,
0x7E, 0x80, 0x80, 0x83, 0x80, 0x85, 0x83, 0x80, 0x83, 0x7E, 0x80, 0x80, 0x7E, 0x81, 0x80, 0x7E, 0x7E, 0x7C, 0x7A, 0x80,
0x7E, 0x80, 0x7E, 0x7E, 0x7E, 0x7E, 0x7C, 0x81, 0x83, 0x80, 0x83, 0x80, 0x80, 0x83, 0x81, 0x83, 0x85, 0x81, 0x83, 0x81,
0x7E, 0x81, 0x7E, 0x7E, 0x81, 0x7E, 0x7E, 0x80, 0x7A, 0x7C, 0x80, 0x7E, 0x81, 0x7E, 0x7E, 0x7C, 0x7E, 0x7E, 0x85, 0x80,
0x81, 0x83, 0x7C, 0x81, 0x83, 0x80, 0x83, 0x81, 0x80, 0x83, 0x80, 0x7E, 0x81, 0x7C, 0x81, 0x80, 0x7E, 0x7E, 0x7E, 0x7A,
0x80, 0x80, 0x80, 0x83, 0x7A, 0x7E, 0x80, 0x80, 0x80, 0x83, 0x80, 0x83, 0x80, 0x7E, 0x83, 0x80, 0x83, 0x83, 0x81, 0x81,
0x81, 0x7E, 0x80, 0x80, 0x7E, 0x83, 0x80, 0x7C, 0x7E, 0x7C, 0x7C, 0x80, 0x7E, 0x80, 0x81, 0x78, 0x80, 0x7C, 0x7E, 0x80,
0x81, 0x7E, 0x81, 0x80, 0x80, 0x81, 0x7E, 0x83, 0x81, 0x81, 0x81, 0x81, 0x7C, 0x80, 0x7E, 0x80, 0x83, 0x7E, 0x7E, 0x7C,
0x7C, 0x7E, 0x80, 0x7E, 0x80, 0x7E, 0x7C, 0x81, 0x7C, 0x81, 0x81, 0x81, 0x81, 0x81, 0x7E, 0x81, 0x81, 0x80, 0x85, 0x80,
0x81, 0x81, 0x80, 0x7E, 0x81, 0x7E, 0x81, 0x83, 0x7C, 0x80, 0x7C, 0x7E, 0x81, 0x80, 0x7E, 0x80, 0x7C, 0x7E, 0x80, 0x7E,
0x81, 0x80, 0x80, 0x81, 0x80, 0x80, 0x83, 0x80, 0x81, 0x83, 0x80, 0x81, 0x80, 0x7E, 0x80, 0x80, 0x80, 0x81, 0x80, 0x7E,
0x80, 0x78, 0x7E, 0x80, 0x81, 0x80, 0x7E, 0x7C, 0x80, 0x7E, 0x80, 0x83, 0x80, 0x81, 0x81, 0x80, 0x81, 0x83, 0x80, 0x83,
0x83, 0x81, 0x83, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x81, 0x7C, 0x7C, 0x7C, 0x7C, 0x81, 0x7E, 0x80, 0x7E, 0x7E, 0x7C, 0x80,
0x7E, 0x80, 0x83, 0x80, 0x83, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x85, 0x81, 0x81, 0x81, 0x7C, 0x80, 0x80, 0x80, 0x81, 0x81,
0x7C, 0x7E, 0x7A, 0x7C, 0x80, 0x7E, 0x80, 0x7E, 0x7E, 0x7E, 0x81, 0x80, 0x81, 0x81, 0x80, 0x83, 0x7E, 0x81, 0x81, 0x80,
0x81, 0x85, 0x81, 0x83, 0x80, 0x7C, 0x83, 0x80, 0x81, 0x81, 0x7E, 0x7C, 0x7E, 0x7C, 0x80, 0x81, 0x7E, 0x81, 0x7C, 0x7E,
0x80, 0x7E, 0x80, 0x80, 0x80, 0x81, 0x83, 0x7E, 0x83, 0x7E, 0x81, 0x83, 0x83, 0x80, 0x81, 0x7C, 0x80, 0x80, 0x80, 0x83,
0x80, 0x7C, 0x7C, 0x7E, 0x7E, 0x81, 0x7E, 0x7C, 0x81, 0x7C, 0x81, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x80, 0x7E, 0x81,
0x7E, 0x83, 0x83, 0x81, 0x80, 0x7E, 0x7C, 0x81, 0x80, 0x81, 0x83, 0x7C, 0x7C, 0x7E, 0x7E, 0x80, 0x80, 0x7E, 0x7E, 0x80,
0x7A, 0x81, 0x7C, 0x80, 0x80, 0x83, 0x80, 0x81, 0x7E, 0x80, 0x81, 0x80, 0x83, 0x81, 0x83, 0x80, 0x7E, 0x7E, 0x81, 0x81,
0x81, 0x81, 0x7A, 0x80, 0x7E, 0x7E, 0x80, 0x81, 0x7E, 0x81, 0x7E, 0x7E, 0x81, 0x7C, 0x81, 0x81, 0x80, 0x81, 0x80, 0x7C,
0x80, 0x80, 0x81, 0x85, 0x81, 0x81, 0x80, 0x7C, 0x80, 0x81, 0x80, 0x81, 0x80, 0x7C, 0x80, 0x7C, 0x80, 0x80, 0x7E, 0x80,
0x80, 0x7C, 0x80, 0x7E, 0x7E, 0x81, 0x80, 0x83, 0x81, 0x80, 0x7E, 0x80, 0x7E, 0x83, 0x85, 0x81, 0x81, 0x7A, 0x80, 0x81,
0x81, 0x83, 0x81, 0x7C, 0x7C, 0x80, 0x7C, 0x81, 0x80, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x7E, 0x80, 0x83, 0x80, 0x83, 0x80,
0x7E, 0x7E, 0x80, 0x81, 0x87, 0x81, 0x80, 0x80, 0x7A, 0x80, 0x80, 0x83, 0x83, 0x81, 0x7C, 0x80, 0x7C, 0x7E, 0x81, 0x7E,
0x80, 0x80, 0x80, 0x7E, 0x7C, 0x7E, 0x81, 0x83, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x81, 0x83, 0x85, 0x81, 0x80, 0x7E, 0x7E,
0x81, 0x80, 0x81, 0x81, 0x7E, 0x7C, 0x7E, 0x7C, 0x80, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x7E, 0x7E, 0x80, 0x83, 0x81, 0x83,
0x81, 0x7C, 0x81, 0x7E, 0x83, 0x85, 0x83, 0x81, 0x81, 0x7C, 0x80, 0x83, 0x80, 0x83, 0x7E, 0x7C, 0x80, 0x7C, 0x7E, 0x80,
0x80, 0x80, 0x81, 0x7E, 0x80, 0x7C, 0x7C, 0x80, 0x83, 0x81, 0x83, 0x7E, 0x7C, 0x80, 0x80, 0x83, 0x85, 0x81, 0x80, 0x7E,
0x7E, 0x80, 0x80, 0x80, 0x81, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x80, 0x7E, 0x81, 0x80, 0x7E, 0x80, 0x7C, 0x7E, 0x83, 0x83,
0x83, 0x83, 0x7E, 0x7E, 0x81, 0x81, 0x85, 0x81, 0x81, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x81, 0x81, 0x7E, 0x80, 0x7C, 0x7E,
0x80, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x7E, 0x7C, 0x81, 0x81, 0x81, 0x83, 0x80, 0x7C, 0x81, 0x81, 0x81, 0x87, 0x7E, 0x81,
0x80, 0x7E, 0x81, 0x81, 0x7E, 0x81, 0x80, 0x7E, 0x81, 0x7A, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x7C, 0x7E, 0x7C, 0x7C, 0x81,
0x80, 0x83, 0x80, 0x7E, 0x7C, 0x81, 0x81, 0x85, 0x81, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x81, 0x81, 0x81, 0x7E, 0x80, 0x7E,
0x7C, 0x7E, 0x7E, 0x81, 0x81, 0x81, 0x7C, 0x7C, 0x7A, 0x80, 0x85, 0x81, 0x81, 0x7E, 0x7E, 0x80, 0x81, 0x83, 0x85, 0x81,
0x80, 0x80, 0x7C, 0x81, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x80, 0x7C, 0x7E, 0x80, 0x7E, 0x83, 0x81, 0x7E, 0x7E, 0x7C, 0x7E,
0x81, 0x81, 0x83, 0x81, 0x7C, 0x80, 0x80, 0x81, 0x83, 0x83, 0x80, 0x80, 0x80, 0x7E, 0x81, 0x7E, 0x81, 0x81, 0x80, 0x80,
0x80, 0x7A, 0x7E, 0x80, 0x80, 0x83, 0x7E, 0x80, 0x7E, 0x7E, 0x7E, 0x83, 0x81, 0x81, 0x80, 0x7C, 0x80, 0x81, 0x83, 0x83,
0x81, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x7E, 0x81, 0x80, 0x81, 0x80, 0x7E, 0x7C, 0x80, 0x7E, 0x81, 0x80, 0x7E, 0x7E, 0x7A,
0x7E, 0x81, 0x81, 0x80, 0x81, 0x7E, 0x80, 0x81, 0x80, 0x83, 0x80, 0x81, 0x81, 0x80, 0x7E, 0x80, 0x7E, 0x7E, 0x83, 0x7E,
0x81, 0x7C, 0x7C, 0x7E, 0x80, 0x80, 0x83, 0x80, 0x7C, 0x7E, 0x7C, 0x80, 0x83, 0x83, 0x81, 0x81, 0x7C, 0x80, 0x81, 0x81,
0x85, 0x80, 0x81, 0x80, 0x7E, 0x7E, 0x80, 0x7C, 0x81, 0x81, 0x80, 0x80, 0x7C, 0x7E, 0x7E, 0x80, 0x81, 0x81, 0x7E, 0x7E,
0x7E, 0x7E, 0x81, 0x83, 0x80, 0x80, 0x80, 0x7E, 0x81, 0x80, 0x81, 0x83, 0x7E, 0x81, 0x80, 0x80, 0x7E, 0x80, 0x7E, 0x83,
0x81, 0x81, 0x80, 0x7C, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x81, 0x81, 0x81, 0x80, 0x80, 0x80, 0x81,
0x80, 0x81, 0x80, 0x80, 0x83, 0x80, 0x80, 0x80, 0x80, 0x81, 0x83, 0x80, 0x80, 0x7C, 0x7A, 0x80, 0x80, 0x83, 0x80, 0x80,
0x7C, 0x7E, 0x7E, 0x81, 0x81, 0x7E, 0x81, 0x80, 0x7E, 0x81, 0x81, 0x80, 0x83, 0x80, 0x81, 0x81, 0x7C, 0x7E, 0x80, 0x80,
0x81, 0x80, 0x7E, 0x80, 0x7C, 0x7E, 0x80, 0x81, 0x83, 0x81, 0x7E, 0x7C, 0x80, 0x80, 0x83, 0x80, 0x80, 0x80, 0x7E, 0x81,
0x80, 0x81, 0x80, 0x80, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x7E, 0x81, 0x81, 0x80, 0x80, 0x7E, 0x7A, 0x81, 0x80, 0x81, 0x81,
0x7C, 0x7E, 0x7E, 0x80, 0x81, 0x83, 0x80, 0x81, 0x80, 0x7E, 0x81, 0x7E, 0x81, 0x80, 0x81, 0x81, 0x81, 0x7E, 0x80, 0x80,
0x7E, 0x83, 0x81, 0x80, 0x7E, 0x7E, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x7C, 0x80, 0x7E, 0x7E, 0x80, 0x80, 0x80, 0x81, 0x7E,
0x80, 0x80, 0x7C, 0x81, 0x81, 0x81, 0x81, 0x81, 0x7E, 0x80, 0x7E, 0x81, 0x81, 0x80, 0x80, 0x7E, 0x7C, 0x7E, 0x81, 0x7E,
0x81, 0x7E, 0x7E, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x81, 0x80, 0x81, 0x80, 0x80, 0x83, 0x81, 0x83, 0x81, 0x80, 0x7E,
0x7E, 0x80, 0x81, 0x80, 0x80, 0x80, 0x7C, 0x7E, 0x80, 0x80, 0x81, 0x81, 0x7E, 0x80, 0x80, 0x80, 0x81, 0x80, 0x81, 0x80,
0x81, 0x80, 0x80, 0x7E, 0x80, 0x81, 0x81, 0x81, 0x7E, 0x7C, 0x7E, 0x7E, 0x80, 0x81, 0x80, 0x80, 0x7E, 0x7C, 0x80, 0x80,
0x80, 0x81, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x80, 0x80, 0x80, 0x80, 0x7E, 0x81, 0x80, 0x80, 0x81, 0x7E,
0x7E, 0x80, 0x80, 0x80, 0x83, 0x80, 0x80, 0x7E, 0x80, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x80, 0x80,
0x81, 0x80, 0x80, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x81, 0x81, 0x7E, 0x80, 0x80, 0x81, 0x81, 0x80, 0x80, 0x80, 0x7E, 0x81,
0x80, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x80, 0x7E, 0x80, 0x7E, 0x81, 0x81, 0x80, 0x80, 0x7E, 0x80, 0x81, 0x81, 0x80, 0x81,
0x7E, 0x80, 0x81, 0x7E, 0x81, 0x80, 0x80, 0x80, 0x7E, 0x7C, 0x81, 0x81, 0x80, 0x80, 0x7E, 0x7E, 0x80, 0x80, 0x80, 0x80,
0x7E, 0x83, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x80, 0x7C, 0x80, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x80, 0x7E,
0x7E, 0x80, 0x7E, 0x81, 0x80, 0x80, 0x80, 0x80, 0x7E, 0x7E, 0x81, 0x80, 0x81, 0x7E, 0x7E, 0x80, 0x80, 0x81, 0x81, 0x80,
0x81, 0x81, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x81, 0x7E, 0x7E, 0x80, 0x81, 0x7E, 0x81, 0x7E, 0x7E, 0x80, 0x7C, 0x80,
0x80, 0x7E, 0x81, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x80, 0x7E, 0x7E, 0x80, 0x80, 0x81, 0x80, 0x7E, 0x80,
0x7E, 0x7E, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x7E, 0x7E, 0x80, 0x81, 0x81, 0x80, 0x81, 0x80, 0x81, 0x7E, 0x81, 0x81,
0x80, 0x80, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x7E,
0x80, 0x80, 0x81, 0x81, 0x81, 0x80, 0x7E, 0x80, 0x7E, 0x81, 0x80, 0x80, 0x80, 0x7C, 0x7E, 0x80, 0x80, 0x80, 0x80, 0x7C,
0x81, 0x7E, 0x80, 0x80, 0x7E, 0x80, 0x80, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x80, 0x81, 0x81, 0x7E, 0x80, 0x80, 0x7E, 0x80,
0x81, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x81, 0x80, 0x81, 0x80, 0x7E, 0x81, 0x7E, 0x81, 0x80, 0x7E, 0x80, 0x80, 0x80, 0x80,
0x80, 0x7C, 0x80, 0x80, 0x81, 0x81, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x7E, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81,
0x7E, 0x80, 0x80, 0x7C, 0x80, 0x7E, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x80, 0x83, 0x80, 0x80, 0x7E, 0x80,
0x80, 0x81, 0x80, 0x80, 0x80, 0x7E, 0x80, 0x7E, 0x80, 0x80, 0x81 };
<span style="color: #aeaeae; font-style: italic;">// Для кнопки</span>
<span style="color: #99cf50;">int</span> b2_code = <span style="color: #3387cc;">2</span>;
<span style="color: #99cf50;">int</span> b2 = <span style="color: #3387cc;">0</span>;
<span style="color: #99cf50;">int</span> ledPin = <span style="color: #3387cc;">13</span>;
<span style="color: #99cf50;">int</span> speakerPin = <span style="color: #3387cc;">11</span>; <span style="color: #aeaeae; font-style: italic;">// Can be either 3 or 11, two PWM outputs connected to Timer 2</span>
<span style="color: #99cf50;">volatile</span> <span style="color: #9b859d;">uint16_t</span> sample;
byte lastSample;
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">stopPlayback</span>()
{
// Disable playback per-sample interrupt.
TIMSK1 &= ~<span style="color: #dad085;">_BV</span>(OCIE1A);
// Disable the per-sample timer completely.
TCCR1B &= ~<span style="color: #dad085;">_BV</span>(CS10);
// Disable the PWM timer.
TCCR2B &= ~<span style="color: #dad085;">_BV</span>(CS10);
digitalWrite(speakerPin, LOW);
}
<span style="color: #aeaeae; font-style: italic;">// This is called at 8000 Hz to load the next sample.</span>
<span style="color: #89bdff;">ISR</span>(TIMER1_COMPA_vect) {
if (sample >= sounddata_length) {
if (sample == sounddata_length + lastSample) {
stopPlayback();
}
else {
if(speakerPin==11){
// Ramp down to zero to reduce the click at the end of playback.
OCR2A = sounddata_length + lastSample - sample;
} else {
OCR2B = sounddata_length + lastSample - sample;
}
}
}
else {
if(speakerPin==11){
OCR2A = pgm_read_byte(&sounddata_data[sample]);
} else {
OCR2B = pgm_read_byte(&sounddata_data[sample]);
}
}
++sample;
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">startPlayback</span>()
{
pinMode(speakerPin, OUTPUT);
// Set up Timer 2 to do pulse width modulation on the speaker
// pin.
// Use internal clock (datasheet p.160)
ASSR &= ~(<span style="color: #dad085;">_BV</span>(EXCLK) | _BV(AS2));
// Set fast PWM <span style="color: #3e87e3;">mode</span> (p.157)
TCCR2A |= _BV(WGM21) | _BV(WGM20);
TCCR2B &= ~<span style="color: #dad085;">_BV</span>(WGM22);
if(speakerPin==11){
// Do non-inverting PWM on pin <span style="color: #3e87e3;">OC2A</span> (p.155)
// On the Arduino this is pin 11.
TCCR2A = (TCCR2A | _BV(COM2A1)) & ~<span style="color: #dad085;">_BV</span>(COM2A0);
TCCR2A &= ~(<span style="color: #dad085;">_BV</span>(COM2B1) | _BV(COM2B0));
// No <span style="color: #3e87e3;">prescaler</span> (p.158)
TCCR2B = (TCCR2B & ~(<span style="color: #dad085;">_BV</span>(CS12) | _BV(CS11))) | _BV(CS10);
// Set initial pulse width to the first sample.
OCR2A = pgm_read_byte(&sounddata_data[0]);
} else {
// Do non-inverting PWM on pin <span style="color: #3e87e3;">OC2B</span> (p.155)
// On the Arduino this is pin 3.
TCCR2A = (TCCR2A | _BV(COM2B1)) & ~<span style="color: #dad085;">_BV</span>(COM2B0);
TCCR2A &= ~(<span style="color: #dad085;">_BV</span>(COM2A1) | _BV(COM2A0));
// No <span style="color: #3e87e3;">prescaler</span> (p.158)
TCCR2B = (TCCR2B & ~(<span style="color: #dad085;">_BV</span>(CS12) | _BV(CS11))) | _BV(CS10);
// Set initial pulse width to the first sample.
OCR2B = pgm_read_byte(&sounddata_data[0]);
}
// Set up Timer 1 to send a sample every interrupt.
cli();
// Set CTC <span style="color: #3e87e3;">mode</span> (Clear Timer on Compare Match) (p.133)
// Have to set OCR1A *after*, otherwise it gets reset to 0!
TCCR1B = (TCCR1B & ~<span style="color: #dad085;">_BV</span>(WGM13)) | _BV(WGM12);
TCCR1A = TCCR1A & ~(<span style="color: #dad085;">_BV</span>(WGM11) | _BV(WGM10));
// No <span style="color: #3e87e3;">prescaler</span> (p.134)
TCCR1B = (TCCR1B & ~(<span style="color: #dad085;">_BV</span>(CS12) | _BV(CS11))) | _BV(CS10);
// Set the compare <span style="color: #3e87e3;">register</span> (OCR1A).
// OCR1A is a 16-bit register, so we have to do this with
// interrupts disabled to be safe.
OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000
// Enable interrupt when TCNT1 == OCR1A (p.136)
TIMSK1 |= _BV(OCIE1A);
lastSample = pgm_read_byte(&sounddata_data[sounddata_length-1]);
sample = 0;
sei();
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">setup</span>()
{
pinMode(b2_code, INPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">loop</span>()
{
// Если нажали кнопку, то проиграем звук
int b2_new = digitalRead(b2_code);
if (b2_new != b2) {
b2 = b2_new;
if (b2_new == 1) {
startPlayback();
}
}
}
</pre>
</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-30920149517188155002014-01-11T00:50:00.000+04:002014-01-11T16:15:47.696+04:00Smoke on the water на Arduino<div dir="ltr" style="text-align: left;" trbidi="on">
Пианино на Arduino. Ну пианино это громко сказано, но кнопки и пищалка есть :)<br />
Пищалку очень слабо тут слышно.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /><object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="https://ytimg.googleusercontent.com/s_vi/-Jmn0VxOsdM/default.jpg?sqp=CMTrxJYF&rs=AOn4CLAut4tNCIThE5YU9sblJgykKT8Fcg"><param name="movie" value="https://www.youtube.com/v/-Jmn0VxOsdM?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="https://www.youtube.com/v/-Jmn0VxOsdM?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
<br />
<a name='more'></a><br />
Для Arduino используется <a href="https://code.google.com/p/arduino-tone/">tone</a>.<br />
<br />
<pre style="background: #000; border-radius: 5px; color: #f8f8f8; padding: 1em;"><span style="color: #8996a8;">#<span style="color: #afc4db;">include</span> <span style="color: #65b042;"><Tone.h></span></span>
Tone tone1;
<span style="color: #aeaeae; font-style: italic;">// digital pin 2 has a pushbutton attached to it. Give it a name:</span>
<span style="color: #99cf50;">int</span> b2_code = <span style="color: #3387cc;">2</span>;
<span style="color: #99cf50;">int</span> b3_code = <span style="color: #3387cc;">3</span>;
<span style="color: #99cf50;">int</span> b4_code = <span style="color: #3387cc;">4</span>;
<span style="color: #99cf50;">int</span> b5_code = <span style="color: #3387cc;">5</span>;
<span style="color: #99cf50;">int</span> b2 = <span style="color: #3387cc;">0</span>;
<span style="color: #99cf50;">int</span> b3 = <span style="color: #3387cc;">0</span>;
<span style="color: #99cf50;">int</span> b4 = <span style="color: #3387cc;">0</span>;
<span style="color: #99cf50;">int</span> b5 = <span style="color: #3387cc;">0</span>;
<span style="color: #aeaeae; font-style: italic;">// the setup routine runs once when you press reset:</span>
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">setup</span>() {
tone1.<span style="color: #dad085;">begin</span>(13);
// initialize serial communication at 9600 bits per second:
Serial.<span style="color: #dad085;">begin</span>(9600);
// make the pushbutton's pin an input:
pinMode(b2_code, INPUT);
pinMode(b3_code, INPUT);
pinMode(b4_code, INPUT);
pinMode(b5_code, INPUT);
}
<span style="color: #aeaeae; font-style: italic;">// the loop routine runs over and over again forever:</span>
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">loop</span>() {
// read the input pin:
int b2_new = digitalRead(b2_code);
int b3_new = digitalRead(b3_code);
int b4_new = digitalRead(b4_code);
int b5_new = digitalRead(b5_code);
// print out the state of the button:
if (b2_new != b2) {
outValue(b2_code, b2_new);
b2 = b2_new;
if (b2_new == 1) {
tone1.<span style="color: #dad085;">play</span>(NOTE_A3);
}
}
if (b3_new != b3) {
outValue(b3_code, b3_new);
b3 = b3_new;
if (b3_new == 1) {
tone1.<span style="color: #dad085;">play</span>(NOTE_C4);
}
}
if (b4_new != b4) {
outValue(b4_code, b4_new);
b4 = b4_new;
if (b4_new == 1) {
tone1.<span style="color: #dad085;">play</span>(NOTE_D4);
}
}
if (b5_new != b5) {
outValue(b5_code, b5_new);
b5 = b5_new;
if (b5_new == 1) {
tone1.<span style="color: #dad085;">play</span>(NOTE_DS4);
}
}
if (b2_new == 0 && b3_new == 0 && b4_new == 0 && b5_new == 0) {
tone1.<span style="color: #dad085;">stop</span>();
}
delay(10); // delay in between reads for stability
}
<span style="color: #99cf50;">void</span> <span style="color: #89bdff;">outValue</span>(int code, int value) {
if (code == b2_code) {
if (value == 0) {
Serial.<span style="color: #dad085;">println</span>("b2: 0");
}
else {
Serial.<span style="color: #dad085;">println</span>("b2: 1");
}
}
if (code == b3_code) {
if (value == 0) {
Serial.<span style="color: #dad085;">println</span>("b3: 0");
}
else {
Serial.<span style="color: #dad085;">println</span>("b3: 1");
}
}
if (code == b4_code) {
if (value == 0) {
Serial.<span style="color: #dad085;">println</span>("b4: 0");
}
else {
Serial.<span style="color: #dad085;">println</span>("b4: 1");
}
}
if (code == b5_code) {
if (value == 0) {
Serial.<span style="color: #dad085;">println</span>("b5: 0");
}
else {
Serial.<span style="color: #dad085;">println</span>("b5: 1");
}
}
}
</pre>
На код и самому смотреть страшненько, но на C давно не писал, поэтому код в стиле спагетти.
</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com1tag:blogger.com,1999:blog-4523257264480589888.post-74575428349937397692014-01-08T20:27:00.003+04:002014-01-08T20:31:00.647+04:00Arduino + web server (node.js + serialport + mongo db + express + d3.js)<div dir="ltr" style="text-align: left;" trbidi="on">
В <a href="http://robotushka.blogspot.ru/2014/01/arduino.html">прошлый раз</a> удалось наладить передачу данных от Arduino на веб сервер.<br />
Теперь следующий шаг, буду записывать данные от датчиков в БД и результат смотреть через браузер.<br />
Для примера сделал такой скетч для Arduino. Просто раз в секунду вычисляю квадратный корень следующего по счёту целого числа.<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">int</span> i <span style="color: #d2cd86;">=</span> <span style="color: #008c00;">0</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">void</span> setup<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
Serial<span style="color: #d2cd86;">.</span>begin<span style="color: #d2cd86;">(</span><span style="color: #008c00;">9600</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">void</span> loop<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
i<span style="color: #d2cd86;">+</span><span style="color: #d2cd86;">+</span><span style="color: #b060b0;">;</span>
Serial<span style="color: #d2cd86;">.</span>println<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">sqrt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
delay<span style="color: #d2cd86;">(</span><span style="color: #008c00;">1000</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
</pre>
<br />
С Arduino разобрался. Далее - работа с веб сервером и СУБД.<br />
<br />
<a name='more'></a><h3 style="text-align: left;">
Веб сервер</h3>
В качестве фреймворка для веб сервера взял <a href="http://expressjs.com/">express</a> для <a href="http://nodejs.org/">node.js</a>. Установил express так, как советуют <a href="http://habrahabr.ru/post/146983/">тут</a>.<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;">$ sudo npm install <span style="color: #00dddd;">-g</span> express
$ express arduino-web
$ <span style="color: #904050;">cd</span> arduino-web
$ npm install
$ node app
</pre>
<br />
После этого пришлось исправить doctype в файле views/layout.jade, для этого заменил первую строку <code>doctype 5</code> на <code>doctype</code>.<br />
По ссылке <a href="http://localhost:3000/">http://localhost:3000/</a> открывается стартовая страничка. Отлично, можно отправить на неё данные с Arduino.<br />
<br />
На клиенте данные буду строить с помощью <a href="http://d3js.org/">D3.js</a>, с помощью этой библиотеки данные легко визуализировать на клиенте, разгрузив сервер.<br />
<br />
В качестве СУБД будет <a href="http://www.mongodb.org/">MongoDB</a>, у неё <a href="http://habrahabr.ru/post/197630/">дешёвая запись</a>. Это может пригодиться, если понадобится часто логировать показания датчиков.<br />
<br />
<h3 style="text-align: left;">
Запись в базу</h3>
У меня Ubuntu, поэтому устанавливаю MongoDB, как описано <a href="http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/">тут</a>.<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;">$ sudo apt-key adv --keyserver hkp<span style="color: #d2cd86;">:</span><span style="color: #40015a;">/</span><span style="color: #40015a;">/keyserver.ubuntu.com</span><span style="color: #d2cd86;">:</span><span style="color: #008c00;">80</span> --recv 7F0CEB10
$ <span style="color: #904050;">echo</span> <span style="color: #00c4c4;">'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen'</span> <span style="color: #e34adc;">|</span> sudo tee <span style="color: #40015a;">/etc/apt/sources.list.d/mongodb.list</span>
$ sudo apt-get install mongodb-10gen
</pre>
<br />
Теперь устанавливаю mongodb для nodejs.
<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;">$ npm install mongodb</pre>
<br />
Данные от Arduino буду записывать в коллекцию sqrt с атрибутами time (текущее время), value (значение).<br />
Для этого делаю такого демона getdata.js, воспользовавшись <a href="http://stepansuvorov.com/blog/2012/10/node-js-%D0%B8-mongodb/">этой</a> удачной статьёй.<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #9999a9;">/**</span>
<span style="color: #9999a9;"> * Сохранение в БД данных от Arduino</span>
<span style="color: #9999a9;"> */</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">Connect to database...</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> _getData <span style="color: #d2cd86;">=</span> <span style="color: #b060b0;">{</span>
database<span style="color: #b060b0;">:</span> <span style="color: #b060b0;">{</span>
mongo<span style="color: #b060b0;">:</span> require<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'mongodb'</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">,</span>
host<span style="color: #b060b0;">:</span> <span style="color: #00c4c4;">'localhost'</span><span style="color: #d2cd86;">,</span>
name<span style="color: #b060b0;">:</span> <span style="color: #00c4c4;">'sqrt'</span><span style="color: #d2cd86;">,</span>
port<span style="color: #b060b0;">:</span> <span style="color: #0f4d75;">null</span><span style="color: #d2cd86;">,</span>
db<span style="color: #b060b0;">:</span> <span style="color: #0f4d75;">null</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">,</span>
arduino<span style="color: #b060b0;">:</span> <span style="color: #b060b0;">{</span>
port<span style="color: #b060b0;">:</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">/dev/ttyACM0</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span>
baudrate<span style="color: #b060b0;">:</span> <span style="color: #008c00;">9600</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span><span style="color: #b060b0;">;</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>port <span style="color: #d2cd86;">=</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>mongo<span style="color: #d2cd86;">.</span>Connection<span style="color: #d2cd86;">.</span>DEFAULT_PORT<span style="color: #b060b0;">;</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>db <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>mongo<span style="color: #d2cd86;">.</span>Db<span style="color: #d2cd86;">(</span>_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>name<span style="color: #d2cd86;">,</span>
<span style="color: #e66170; font-weight: bold;">new</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>mongo<span style="color: #d2cd86;">.</span>Server<span style="color: #d2cd86;">(</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>host<span style="color: #d2cd86;">,</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>port<span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span><span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>safe<span style="color: #b060b0;">:</span> <span style="color: #0f4d75;">false</span><span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #9999a9;">// Соединяемся с БД</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>db<span style="color: #d2cd86;">.</span>open<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>err<span style="color: #d2cd86;">,</span> db<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">Connected to database.</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #9999a9;">// Подключаемся к порту</span>
<span style="color: #e66170; font-weight: bold;">var</span> serialport <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">serialport</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> SerialPort <span style="color: #d2cd86;">=</span> serialport<span style="color: #d2cd86;">.</span>SerialPort<span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> serialPort <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> SerialPort<span style="color: #d2cd86;">(</span>_getData<span style="color: #d2cd86;">.</span>arduino<span style="color: #d2cd86;">.</span>port<span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>
baudrate<span style="color: #b060b0;">:</span> _getData<span style="color: #d2cd86;">.</span>arduino<span style="color: #d2cd86;">.</span>baudrate
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">open</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #9999a9;">// Читаем данные из порта</span>
<span style="color: #e66170; font-weight: bold;">var</span> readData <span style="color: #d2cd86;">=</span> <span style="color: #02d045;">"</span><span style="color: #02d045;">"</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> first <span style="color: #d2cd86;">=</span> <span style="color: #0f4d75;">true</span><span style="color: #b060b0;">;</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">Waiting for data from Arduino...</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'data'</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">var</span> dataStr <span style="color: #d2cd86;">=</span> data<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">toString</span><span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #9999a9;">// Парсим данные (делим на строки)</span>
<span style="color: #e66170; font-weight: bold;">for</span> <span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">var</span> i <span style="color: #d2cd86;">=</span> <span style="color: #008c00;">0</span><span style="color: #d2cd86;">,</span> l <span style="color: #d2cd86;">=</span> dataStr<span style="color: #d2cd86;">.</span>length<span style="color: #b060b0;">;</span> i <span style="color: #d2cd86;"><</span> l<span style="color: #b060b0;">;</span> i<span style="color: #d2cd86;">++</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span>dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">!=</span> <span style="color: #02d045;">"</span><span style="color: teal;">\n</span><span style="color: #02d045;">"</span> <span style="color: #d2cd86;">&&</span> dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">!=</span> <span style="color: #02d045;">"</span><span style="color: teal;">\r</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
readData <span style="color: #d2cd86;">+=</span> dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">else</span> <span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span>readData<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #9999a9;">// Пропускаем первое полученное значение</span>
<span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">!</span>first<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
db<span style="color: #d2cd86;">.</span>collection<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'sqrt'</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>err<span style="color: #d2cd86;">,</span> collection<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">var</span> date <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> Date<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #9999a9;">// Сохраняем значение в базу</span>
collection<span style="color: #d2cd86;">.</span>insert<span style="color: #d2cd86;">(</span><span style="color: #b060b0;">{</span>
time<span style="color: #b060b0;">:</span> date<span style="color: #d2cd86;">,</span>
value<span style="color: #b060b0;">:</span> readData
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span>date <span style="color: #d2cd86;">+</span> <span style="color: #00c4c4;">': '</span> <span style="color: #d2cd86;">+</span> readData <span style="color: #d2cd86;">+</span> <span style="color: #00c4c4;">';'</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">else</span> <span style="color: #b060b0;">{</span>
first <span style="color: #d2cd86;">=</span> <span style="color: #0f4d75;">false</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
readData <span style="color: #d2cd86;">=</span> <span style="color: #02d045;">"</span><span style="color: #02d045;">"</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Чтобы он работал, устанавливаю ещё serialport и запускаю демона.<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;">$ npm install serialport
$ node getdata<span style="color: #e66170; font-weight: bold;">.</span>js</pre>
<h3 style="text-align: left;">
Отображение данных в браузере</h3>
Данные, которые присылает Arduino, сохраняются в БД. Теперь можно написать кусок кода, с помощью которого эти данные можно будет увидеть в браузере. Далее я буду каждые 5 секунд отправлять на сервер AJAX запрос для получения информации за последние 5 минут.<br />
<br />
Вот какие манипуляции для этого совершаю.<br />
Один. Прописываю маршрут для express. В файле app.js добавляю строки<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">var</span> data <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'./routes/get-data'</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #d2cd86;">.</span><span style="color: #d2cd86;">.</span><span style="color: #d2cd86;">.</span>
app<span style="color: #d2cd86;">.</span>get<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'/get-data'</span><span style="color: #d2cd86;">,</span> data<span style="color: #d2cd86;">.</span>get_data<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Два. Забираю данные из БД (в routes/get-data.js.).<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #9999a9;">/*</span>
<span style="color: #9999a9;"> * GET home page.</span>
<span style="color: #9999a9;"> */</span>
exports<span style="color: #d2cd86;">.</span>get_data <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>req<span style="color: #d2cd86;">,</span> res<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">{</span>
<span style="color: #9999a9;">// Читаем данные из БД</span>
<span style="color: #e66170; font-weight: bold;">var</span> _getData <span style="color: #d2cd86;">=</span> <span style="color: #b060b0;">{</span>
database<span style="color: #b060b0;">:</span> <span style="color: #b060b0;">{</span>
mongo<span style="color: #b060b0;">:</span> require<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'mongodb'</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">,</span>
host<span style="color: #b060b0;">:</span> <span style="color: #00c4c4;">'localhost'</span><span style="color: #d2cd86;">,</span>
name<span style="color: #b060b0;">:</span> <span style="color: #00c4c4;">'sqrt'</span><span style="color: #d2cd86;">,</span>
port<span style="color: #b060b0;">:</span> <span style="color: #0f4d75;">null</span><span style="color: #d2cd86;">,</span>
db<span style="color: #b060b0;">:</span> <span style="color: #0f4d75;">null</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span><span style="color: #b060b0;">;</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>port <span style="color: #d2cd86;">=</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>mongo<span style="color: #d2cd86;">.</span>Connection<span style="color: #d2cd86;">.</span>DEFAULT_PORT<span style="color: #b060b0;">;</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>db <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>mongo<span style="color: #d2cd86;">.</span>Db<span style="color: #d2cd86;">(</span>_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>name<span style="color: #d2cd86;">,</span>
<span style="color: #e66170; font-weight: bold;">new</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>mongo<span style="color: #d2cd86;">.</span>Server<span style="color: #d2cd86;">(</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>host<span style="color: #d2cd86;">,</span> _getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>port<span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span><span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>safe<span style="color: #b060b0;">:</span> <span style="color: #0f4d75;">false</span><span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #9999a9;">// Соединяемся с БД</span>
_getData<span style="color: #d2cd86;">.</span>database<span style="color: #d2cd86;">.</span>db<span style="color: #d2cd86;">.</span>open<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>err<span style="color: #d2cd86;">,</span> db<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
db<span style="color: #d2cd86;">.</span>collection<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'sqrt'</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>err<span style="color: #d2cd86;">,</span> collection<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #9999a9;">// Выбераем из таблицы всё, что не старее 10 минут</span>
<span style="color: #e66170; font-weight: bold;">var</span> dateFrom <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> Date<span style="color: #d2cd86;">(</span>Date<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">parse</span><span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">new</span> Date<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">-</span> <span style="color: #008c00;">1000</span> <span style="color: #d2cd86;">*</span> <span style="color: #008c00;">60</span> <span style="color: #d2cd86;">*</span> <span style="color: #008c00;">10</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
collection<span style="color: #d2cd86;">.</span>find<span style="color: #d2cd86;">(</span><span style="color: #b060b0;">{</span>time<span style="color: #b060b0;">:</span> <span style="color: #b060b0;">{</span><span style="color: #00c4c4;">'$gt'</span><span style="color: #b060b0;">:</span> dateFrom<span style="color: #b060b0;">}</span><span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">toArray</span><span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>err<span style="color: #d2cd86;">,</span> docs<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span>docs<span style="color: #d2cd86;">.</span>length<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
res<span style="color: #d2cd86;">.</span>send<span style="color: #d2cd86;">(</span>JSON<span style="color: #d2cd86;">.</span>stringify<span style="color: #d2cd86;">(</span>docs<span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
db<span style="color: #d2cd86;">.</span>close<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Три. Отображаю данные в браузере, по аналогии с <a href="http://bl.ocks.org/mbostock/3883245">этим</a> примером (в javascripts/getdata.js).<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">var</span> margin <span style="color: #d2cd86;">=</span> <span style="color: #b060b0;">{</span>top<span style="color: #b060b0;">:</span> <span style="color: #008c00;">20</span><span style="color: #d2cd86;">,</span> right<span style="color: #b060b0;">:</span> <span style="color: #008c00;">20</span><span style="color: #d2cd86;">,</span> bottom<span style="color: #b060b0;">:</span> <span style="color: #008c00;">30</span><span style="color: #d2cd86;">,</span> left<span style="color: #b060b0;">:</span> <span style="color: #008c00;">50</span><span style="color: #b060b0;">}</span><span style="color: #d2cd86;">,</span>
width <span style="color: #d2cd86;">=</span> <span style="color: #008c00;">960</span> <span style="color: #d2cd86;">-</span> margin<span style="color: #d2cd86;">.</span>left <span style="color: #d2cd86;">-</span> margin<span style="color: #d2cd86;">.</span>right<span style="color: #d2cd86;">,</span>
height <span style="color: #d2cd86;">=</span> <span style="color: #008c00;">500</span> <span style="color: #d2cd86;">-</span> margin<span style="color: #d2cd86;">.</span>top <span style="color: #d2cd86;">-</span> margin<span style="color: #d2cd86;">.</span>bottom<span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> x <span style="color: #d2cd86;">=</span> d3<span style="color: #d2cd86;">.</span>time<span style="color: #d2cd86;">.</span>scale<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>range<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">[</span><span style="color: #008c00;">0</span><span style="color: #d2cd86;">,</span> width<span style="color: #d2cd86;">]</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> y <span style="color: #d2cd86;">=</span> d3<span style="color: #d2cd86;">.</span>scale<span style="color: #d2cd86;">.</span>linear<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>range<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">[</span>height<span style="color: #d2cd86;">,</span> <span style="color: #008c00;">0</span><span style="color: #d2cd86;">]</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> xAxis <span style="color: #d2cd86;">=</span> d3<span style="color: #d2cd86;">.</span>svg<span style="color: #d2cd86;">.</span>axis<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>scale<span style="color: #d2cd86;">(</span>x<span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>orient<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">bottom</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> yAxis <span style="color: #d2cd86;">=</span> d3<span style="color: #d2cd86;">.</span>svg<span style="color: #d2cd86;">.</span>axis<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>scale<span style="color: #d2cd86;">(</span>y<span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>orient<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">left</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> line <span style="color: #d2cd86;">=</span> d3<span style="color: #d2cd86;">.</span>svg<span style="color: #d2cd86;">.</span>line<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>x<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #e66170; font-weight: bold;">return</span> x<span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">.</span>time<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span> <span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>y<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #e66170; font-weight: bold;">return</span> y<span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">.</span>value<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span> <span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> svg <span style="color: #d2cd86;">=</span> d3<span style="color: #d2cd86;">.</span>select<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">#data</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">.</span>append<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">svg</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">width</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> width <span style="color: #d2cd86;">+</span> margin<span style="color: #d2cd86;">.</span>left <span style="color: #d2cd86;">+</span> margin<span style="color: #d2cd86;">.</span>right<span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">height</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> height <span style="color: #d2cd86;">+</span> margin<span style="color: #d2cd86;">.</span>top <span style="color: #d2cd86;">+</span> margin<span style="color: #d2cd86;">.</span>bottom<span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>append<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">g</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">transform</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">translate(</span><span style="color: #02d045;">"</span> <span style="color: #d2cd86;">+</span> margin<span style="color: #d2cd86;">.</span>left <span style="color: #d2cd86;">+</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">,</span><span style="color: #02d045;">"</span> <span style="color: #d2cd86;">+</span> margin<span style="color: #d2cd86;">.</span>top <span style="color: #d2cd86;">+</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">)</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
getData<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
setInterval<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> getData<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span> <span style="color: #b060b0;">}</span><span style="color: #d2cd86;">,</span> <span style="color: #008c00;">1000</span><span style="color: #d2cd86;">*</span><span style="color: #008c00;">5</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">function</span> getData<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
d3<span style="color: #d2cd86;">.</span>json<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">get-data</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>error<span style="color: #d2cd86;">,</span> data<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
data<span style="color: #d2cd86;">.</span>forEach<span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
d<span style="color: #d2cd86;">.</span>time <span style="color: #d2cd86;">=</span> Date<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">parse</span><span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">.</span>time<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
d<span style="color: #d2cd86;">.</span>value <span style="color: #d2cd86;">=</span> <span style="color: #d2cd86;">+</span>d<span style="color: #d2cd86;">.</span>value<span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
x<span style="color: #d2cd86;">.</span>domain<span style="color: #d2cd86;">(</span>d3<span style="color: #d2cd86;">.</span>extent<span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #e66170; font-weight: bold;">return</span> d<span style="color: #d2cd86;">.</span>time<span style="color: #b060b0;">;</span> <span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
y<span style="color: #d2cd86;">.</span>domain<span style="color: #d2cd86;">(</span>d3<span style="color: #d2cd86;">.</span>extent<span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span><span style="color: #d2cd86;">(</span>d<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #e66170; font-weight: bold;">return</span> d<span style="color: #d2cd86;">.</span>value<span style="color: #b060b0;">;</span> <span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
svg<span style="color: #d2cd86;">.</span>selectAll<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">g</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>remove<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
svg<span style="color: #d2cd86;">.</span>append<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">g</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">class</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">x axis</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">transform</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">translate(0,</span><span style="color: #02d045;">"</span> <span style="color: #d2cd86;">+</span> height <span style="color: #d2cd86;">+</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">)</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>call<span style="color: #d2cd86;">(</span>xAxis<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
svg<span style="color: #d2cd86;">.</span>append<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">g</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">class</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">y axis</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>call<span style="color: #d2cd86;">(</span>yAxis<span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>append<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">text</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">transform</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">rotate(-90)</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">y</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #008c00;">6</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">dy</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">.71em</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>style<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">text-anchor</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">end</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>text<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">Value</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
svg<span style="color: #d2cd86;">.</span>selectAll<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">path</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>remove<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
svg<span style="color: #d2cd86;">.</span>append<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">path</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>datum<span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">class</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #02d045;">"</span><span style="color: #00c4c4;">line</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span>
<span style="color: #d2cd86;">.</span>attr<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">d</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> line<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
</pre>
<br />
В итоге получаю такую картинку:<br />
<a href="http://www.zimagez.com/zimage/-08012014-175923.php">
<img src="http://www.zimagez.com/miniature/-08012014-175923.php" />
</a>
<br />
<br />
Каждые 5 секунд она обновляется.<br />
<br />
Всё. За качество кода не боролся, главная задача тут - отработать подход и убедиться, что нет серьёзных подводных камней. Код этого примера можно посмотреть на <a href="https://github.com/iriscrm/arduino-web">Гитхабе</a>.</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-15790638248239718312014-01-07T06:58:00.001+04:002014-01-08T18:17:54.497+04:00Приём на сервере данных от Arduino<div dir="ltr" style="text-align: left;" trbidi="on">
Для передачи данных на сервер буду использовать последовательное соединение (<a href="https://github.com/voodootikigod/node-serialport">serialport</a>). Соединяю Arduino с компьютером через USB.<br />
<br />
Код для Arduino (из <a href="http://robotushka.blogspot.ru/2013/12/arduino.html">этого примера</a>):<br />
<pre style="background-color: black; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #9999a9;">/*</span>
<span style="color: #9999a9;"> AnalogReadSerial</span>
<span style="color: #9999a9;"> Reads an analog input on pin 0, prints the result to the serial monitor </span>
<span style="color: #9999a9;"></span>
<span style="color: #9999a9;"> This example code is in the public domain.</span>
<span style="color: #9999a9;"> */</span>
<span style="color: #e66170; font-weight: bold;">void</span> setup<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
Serial<span style="color: #d2cd86;">.</span>begin<span style="color: #d2cd86;">(</span><span style="color: #008c00;">9600</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">void</span> loop<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">int</span> sensorValue <span style="color: #d2cd86;">=</span> analogRead<span style="color: #d2cd86;">(</span>A0<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
Serial<span style="color: #d2cd86;">.</span>println<span style="color: #d2cd86;">(</span>sensorValue<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span></pre>
<br />
Т.е. на сервере буду ловить целые числа.<br />
<br />
<a name='more'></a><br />
Код для сервера (<a href="http://nodejs.org/">node.js</a>), как не надо делать:<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">var</span> SerialPort <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">serialport</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">.</span>SerialPort<span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> serialPort <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> SerialPort<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">/dev/ttyACM0</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>
baudrate<span style="color: #b060b0;">:</span> <span style="color: #008c00;">9600</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'data'</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span> <span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #9999a9;">// call back when data is received</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">toString</span><span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">+</span> <span style="color: #00c4c4;">';'</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Как видно, тут есть нюанс. Данные от Arduino приходят в виде каши, которую надо упорядочить. Т.е. вывод выглядит примерно так.<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #008c00;">35</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">0</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">35</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">1</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">3</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">51</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">35</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">0</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">34</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">9</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">351</span>
<span style="color: #008c00;">350</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">3493</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">49</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">350</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Чтобы получать адекватные данные, разбираю их вручную, т.е. складываю в буфер readData и вручную разделяю на порции (в данном случае смотрю, чтобы данные были разделены с помощью \n и \r).<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">var</span> SerialPort <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">serialport</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #d2cd86;">.</span>SerialPort<span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> serialPort <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> SerialPort<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">/dev/ttyACM0</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>
baudrate<span style="color: #b060b0;">:</span> <span style="color: #008c00;">9600</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> readData <span style="color: #d2cd86;">=</span> <span style="color: #02d045;">"</span><span style="color: #02d045;">"</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'data'</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span> <span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #9999a9;">// call back when data is received</span>
dataStr <span style="color: #d2cd86;">=</span> data<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">toString</span><span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">for</span> <span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">var</span> i <span style="color: #d2cd86;">=</span> <span style="color: #008c00;">0</span><span style="color: #d2cd86;">,</span> l <span style="color: #d2cd86;">=</span> dataStr<span style="color: #d2cd86;">.</span>length<span style="color: #b060b0;">;</span> i <span style="color: #d2cd86;"><</span> l<span style="color: #b060b0;">;</span> i<span style="color: #d2cd86;">++</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span>dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">!=</span> <span style="color: #02d045;">"</span><span style="color: teal;">\n</span><span style="color: #02d045;">"</span> <span style="color: #d2cd86;">&&</span> dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">!=</span> <span style="color: #02d045;">"</span><span style="color: teal;">\r</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
readData <span style="color: #d2cd86;">+=</span> dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">else</span> <span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span>readData<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span>readData <span style="color: #d2cd86;">+</span> <span style="color: #00c4c4;">';'</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
readData <span style="color: #d2cd86;">=</span> <span style="color: #02d045;">"</span><span style="color: #02d045;">"</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Получаю то, что требовалось:<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 1em;"><span style="color: #008c00;">351</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">350</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">349</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">351</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">350</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">349</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">349</span><span style="color: #b060b0;">;</span>
<span style="color: #008c00;">350</span><span style="color: #b060b0;">;</span>
</pre>
<br />
По сути, получился Serial Monitor.<br />
<br />
<b>UPD:</b><br />
В дальнейшем заметил, что в начале вывода присутствуют странные символы, от них избавился так:<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">var</span> serialport <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">serialport</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> SerialPort <span style="color: #d2cd86;">=</span> serialport<span style="color: #d2cd86;">.</span>SerialPort<span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> serialPort <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> SerialPort<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">/dev/ttyACM0</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>
baudrate<span style="color: #b060b0;">:</span> <span style="color: #008c00;">9600</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">open</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span> <span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">''</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>flush<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> readData <span style="color: #d2cd86;">=</span> <span style="color: #02d045;">"</span><span style="color: #02d045;">"</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'data'</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span> <span style="color: #d2cd86;">(</span>data<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span> <span style="color: #9999a9;">// call back when data is received</span>
<span style="color: #e66170; font-weight: bold;">var</span> dataStr <span style="color: #d2cd86;">=</span> data<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">toString</span><span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">for</span> <span style="color: #d2cd86;">(</span><span style="color: #e66170; font-weight: bold;">var</span> i <span style="color: #d2cd86;">=</span> <span style="color: #008c00;">0</span><span style="color: #d2cd86;">,</span> l <span style="color: #d2cd86;">=</span> dataStr<span style="color: #d2cd86;">.</span>length<span style="color: #b060b0;">;</span> i <span style="color: #d2cd86;"><</span> l<span style="color: #b060b0;">;</span> i<span style="color: #d2cd86;">++</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span>dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">!=</span> <span style="color: #02d045;">"</span><span style="color: teal;">\n</span><span style="color: #02d045;">"</span> <span style="color: #d2cd86;">&&</span> dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span> <span style="color: #d2cd86;">!=</span> <span style="color: #02d045;">"</span><span style="color: teal;">\r</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
readData <span style="color: #d2cd86;">+=</span> dataStr<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">charAt</span><span style="color: #d2cd86;">(</span>i<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">else</span> <span style="color: #e66170; font-weight: bold;">if</span> <span style="color: #d2cd86;">(</span>readData<span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span>readData <span style="color: #d2cd86;">+</span> <span style="color: #00c4c4;">';'</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
readData <span style="color: #d2cd86;">=</span> <span style="color: #02d045;">"</span><span style="color: #02d045;">"</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Вариант с указанием потока ввода:<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; color: #d1d1d1; color: #d1d1d1; padding: 1em;"><span style="color: #e66170; font-weight: bold;">var</span> serialport <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">serialport</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> SerialPort <span style="color: #d2cd86;">=</span> serialport<span style="color: #d2cd86;">.</span>SerialPort<span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> serialPort <span style="color: #d2cd86;">=</span> <span style="color: #e66170; font-weight: bold;">new</span> SerialPort<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">/dev/ttyACM0</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #b060b0;">{</span>
baudrate<span style="color: #b060b0;">:</span> <span style="color: #008c00;">9600</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>on<span style="color: #d2cd86;">(</span><span style="color: #02d045;">"</span><span style="color: #00c4c4;">open</span><span style="color: #02d045;">"</span><span style="color: #d2cd86;">,</span> <span style="color: #e66170; font-weight: bold;">function</span> <span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
console<span style="color: #d2cd86;">.</span><span style="color: #e66170; font-weight: bold;">log</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">''</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
serialPort<span style="color: #d2cd86;">.</span>flush<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> readline <span style="color: #d2cd86;">=</span> require<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">'readline'</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">var</span> rl <span style="color: #d2cd86;">=</span> readline<span style="color: #d2cd86;">.</span>createInterface<span style="color: #d2cd86;">(</span><span style="color: #b060b0;">{</span>
input<span style="color: #b060b0;">:</span> serialPort<span style="color: #d2cd86;">,</span>
output<span style="color: #b060b0;">:</span> process<span style="color: #d2cd86;">.</span>stdout
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
</pre>
<br />
Почему в обоих случаях без строки console.log('') работает криво, пока идей нет. Надеюсь, что это связано не с чтением из порта, а с выводом в консоль. Но мне интереснее, что будет при выводе в веб интерфейс, это я попробую сделать в следующий раз.<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-34460001121244068192013-12-30T02:15:00.001+04:002013-12-30T22:33:25.870+04:00Яркость светодиода<div dir="ltr" style="text-align: left;" trbidi="on">
На пути к светлому робунизму собрал еще одну простую схему, проверил взаимодействие входа с выходом.<br />
<div class="separator" style="clear: both; text-align: center;">
<object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i1.ytimg.com/vi/1QT1rO_dDRY/0.jpg"><param name="movie" value="http://www.youtube.com/v/1QT1rO_dDRY?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/1QT1rO_dDRY?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<a name='more'></a><br />
При изменении величины на аналоговом входе A0 устанавливаем значение на выходе 9:<br />
<br />
<pre style="background: #000000; border-radius: 5px; color: #d1d1d1; padding: 10px;"><span style="color: #e66170; font-weight: bold;">void</span> setup<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
pinMode<span style="color: #d2cd86;">(</span><span style="color: #008c00;">9</span><span style="color: #d2cd86;">,</span> OUTPUT<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
Serial<span style="color: #d2cd86;">.</span>begin<span style="color: #d2cd86;">(</span><span style="color: #008c00;">9600</span><span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
<span style="color: #e66170; font-weight: bold;">void</span> loop<span style="color: #d2cd86;">(</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
<span style="color: #e66170; font-weight: bold;">int</span> sensorValue <span style="color: #d2cd86;">=</span> analogRead<span style="color: #d2cd86;">(</span>A0<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #e66170; font-weight: bold;">int</span> brightness <span style="color: #d2cd86;">=</span> sensorValue <span style="color: #d2cd86;">/</span> <span style="color: #008c00;">4</span><span style="color: #b060b0;">;</span>
analogWrite<span style="color: #d2cd86;">(</span><span style="color: #008c00;">9</span><span style="color: #d2cd86;">,</span> brightness<span style="color: #d2cd86;">)</span><span style="color: #b060b0;">;</span>
<span style="color: #b060b0;">}</span>
</pre>
<br />
Сопротивление взял, как <a href="http://arduino.cc/en/Tutorial/Fade" target="_blank">тут</a>, 220 Ом. Но потом поставил 1кОм, чтобы в глаза поменьше светило :)</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-13839599563067597422013-12-29T00:12:00.003+04:002013-12-30T09:06:20.162+04:00Архитектура умного дома<div dir="ltr" style="text-align: left;" trbidi="on">
Пообщавшись с <a class="g-profile" href="http://plus.google.com/104354941237795359832" target="_blank">коллегой</a>, нарисовали несколько схем, как может выглядеть архитектурное решение для автоматизации дома. И остановились на таком варианте, схемку быстренько набросал в <a href="https://www.lucidchart.com/" target="_blank">lucidchart</a>.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpIOpv2rVWEIwmZ-yLfT77YxkihWbcfFNDPMNYbFQD1-d71QpsuC7X7ihSYizqiS6Ryyu5Ypw8xyNpLZwiDzPUyO0G7MNFwZko_aPxM6TWTV-rsr5EecXrZLi7Ij_ys6AfZ_TwEEnnObs/s1600/Smart+House+Architecture+-+New+Page+(1).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpIOpv2rVWEIwmZ-yLfT77YxkihWbcfFNDPMNYbFQD1-d71QpsuC7X7ihSYizqiS6Ryyu5Ypw8xyNpLZwiDzPUyO0G7MNFwZko_aPxM6TWTV-rsr5EecXrZLi7Ij_ys6AfZ_TwEEnnObs/s320/Smart+House+Architecture+-+New+Page+(1).png" width="320" /></a></div>
<br />
Далее - кратко о сути схемы.<br />
<br />
<a name='more'></a><br />
<br />
<ul style="text-align: left;">
<li>Веб сервер нужен для отображения информации и приёма команд на любом устройстве.</li>
<ul>
<li>Сам веб сервер планируем развернуть на <a href="http://ru.wikipedia.org/wiki/Raspberry_Pi" target="_blank">малинке</a>, она дешёвая и может работать без вентиляторов. Чем меньше механических составляющих, тем лучше, на мой взгляд. Если малинной мощности будет не хватать, можно будет взять что-то помощнее, типа <a href="http://ru.wikipedia.org/wiki/Cubieboard" target="_blank">CubieTruck</a>.</li>
<li>При наличии связи веб сервера с Интернет, домом можно будет управлять издалека.</li>
<li>Сделаем <a href="http://getbootstrap.com/" target="_blank">адаптивный дизайн</a>, чтобы можно было смотреть на показания датчиков и управлять домом как с компа, так и с мобильных устройств.</li>
<li>Для вывода информации, возможно, воспользуемся <a href="http://d3js.org/" target="_blank">d3js</a>, чтобы посильнее разгрузить веб сервер и побольше графики и таблиц рисовать на клиенте.</li>
</ul>
<li>Коммутатор нужен для того, чтобы избежать конфликтов сигналов от различных датчиков и устройств. Например, веб сервер запрашивает показания температуры в одной комнате. А в это время очухался, например, контроллер датчика освещённости и выслал свой результат. Коммутатор поможет избежать такой неразберихи и примет только нужный сигнал.</li>
<ul>
<li>В каких-то случаях нам не захочется тянуть много длинных проводов от коммутатора к каждому контроллеру. Для этого будем снова использовать коммутаторы следующего уровня (Sub Commutator). Надо предусмотреть, чтобы таких уровней могло быть много. Т.е. будет дерево из коммутаторов.</li>
<li>Если проводков от устройств будет так много, что все они не будут помещаться в разъёмы одного коммутатора, то дерево коммутаторов снова придёт на помощь.</li>
</ul>
<li>Каждый датчик или устройство будет работать вместе со своим контроллером (Controller 1... N).</li>
<ul>
<li>Это нужно в первую очередь для того, чтобы наладить связь коммутатор-устройство. Каждый такой контроллер должен иметь свой уникальный идентификатор, чтобы к нему можно было адресоваться.</li>
<li>Вторая роль контроллера - организация автономной работы устройства.</li>
</ul>
</ul>
<br />
Вот и вся архитектура.<br />
Как видно, в этом варианте есть минус - аппаратная избыточность. Но взамен мы получаем легко масштабируемую структуру и прозрачность.<br />
Другими словами - система получается дороже на первом этапе (при покупке оборудования), но дешевле в дальнейшем (проще писать код, поддерживать и расширять систему).<br />
<br />
И один нюанс :) Это теория. Надеюсь, удастся посмотреть, что будет на практике, возможно, тогда и схемку скорректируем.<br />
Если есть что сказать/посоветовать, комментируйте, будем рады.<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-49606963844830332092013-12-28T15:59:00.002+04:002013-12-30T09:06:47.548+04:00Макетная плата<div dir="ltr" style="text-align: left;" trbidi="on">
Сегодня попробовал собрать <a href="http://robotushka.blogspot.ru/2013/12/arduino.html">схему с переменным сопротивлением</a> на макетной плате. <a href="http://robocraft.ru/blog/electronics/1008.html">Тут</a> хорошо расписано, как соединены контакты макетной платы. Вот что вышло.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-FkZW0lg_mxw/Ur66ltPimpI/AAAAAAAAOiA/kovo28KjoX0/s1600/DSC_2137.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://3.bp.blogspot.com/-FkZW0lg_mxw/Ur66ltPimpI/AAAAAAAAOiA/kovo28KjoX0/s320/DSC_2137.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
В дальнейшем я собираюсь автоматизировать часть дома и буду тестировать функции, которые понадобятся для умного дома. Но для этого надо понимать архитектуру решения в целом. Пока что мне она представляется смутно. Сегодня пообщаюсь с коллегой и в следующем посте нарисую ориентировочную схему общего решения, чтобы было понятно, куда двигаться дальше.</div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0tag:blogger.com,1999:blog-4523257264480589888.post-5327218770653409262013-12-24T01:58:00.001+04:002013-12-30T09:07:08.070+04:00Знакомство с Arduino<div dir="ltr" style="text-align: left;" trbidi="on">
Сегодня забрал с почты <a href="http://www.aliexpress.com/snapshot/303758980.html">такой</a> набор Arduino Uno. Заказывал его одной посылкой у одного и того-же продавца вместе с <a href="http://www.aliexpress.com/snapshot/303758978.html">этим</a> блоком питания и платой <a href="http://www.aliexpress.com/snapshot/303758979.html">Raspbery Pi</a>. Всё хорошо. Ну разве что продавец постарался уместить всё в одну посылку и, видимо, по причине своей китайской скупости забыл положить туда USB кабель, который должен был идти в комплекте, и Raspbery не стал класть в стильный розовый корпус, а положил просто в коробочку с набором. Буду иметь ввиду такие хитрости и заказывать посылки по-очереди :)<br />
Далее - несколько фото набора, попытка включить Arduino и поиграть в этот чудный конструктор для пупсиков.<br />
<br />
Забегая вперёд, вот, что получилось в первый раз:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/--25kQMB93l0/UrizabugJZI/AAAAAAAAL9Q/ke9f34qf0JI/s1600/23.12.13+-+1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://2.bp.blogspot.com/--25kQMB93l0/UrizabugJZI/AAAAAAAAL9Q/ke9f34qf0JI/s320/23.12.13+-+1" width="320" /></a></div>
<br />
<br />
<a name='more'></a><br />
В коробке набор выглядит так:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWEC3NhOQ__DXVqPdQrbkdUQX6j4249hLwM9AWY_ydxICTmKXre-tz_vQHpI5qkCC_oVzArgpo44-4MHzdoMuUdlZk13itXJdzHHJzu0FXepnUZG7mJinxwloPIXGnXlg7g4XqlePFyI8/s1600/DSC_2109.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWEC3NhOQ__DXVqPdQrbkdUQX6j4249hLwM9AWY_ydxICTmKXre-tz_vQHpI5qkCC_oVzArgpo44-4MHzdoMuUdlZk13itXJdzHHJzu0FXepnUZG7mJinxwloPIXGnXlg7g4XqlePFyI8/s320/DSC_2109.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Открываем коробчёнку:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy3gpr2jXugeYF4RBccnaG9fyfdNgqgt2ls3eS93khJ-Xd4Usa3SMb6W1-ANla-63_DWMJvWaac77LjikFJHsi1-oRDKVDJANH1meuL-68ojQ0Pad_FbD_8TlY0Lx5Ymh6kqyXHYxVD3I/s1600/DSC_2110.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy3gpr2jXugeYF4RBccnaG9fyfdNgqgt2ls3eS93khJ-Xd4Usa3SMb6W1-ANla-63_DWMJvWaac77LjikFJHsi1-oRDKVDJANH1meuL-68ojQ0Pad_FbD_8TlY0Lx5Ymh6kqyXHYxVD3I/s320/DSC_2110.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
А там двойное дно:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLM-ICuW3mtjA-RoBQ6PrO0dRHO4wLe8kPVcDkeRAXhOEWSP0NYsasMqWN_g7-63LThHoYQALOqQnXGlHwF76fmdhe8ZU7JUkZOIoiGl9Vrh1GbC25uapyrYnTthi0awcXIaBWkZYgTtY/s1600/DSC_2111.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLM-ICuW3mtjA-RoBQ6PrO0dRHO4wLe8kPVcDkeRAXhOEWSP0NYsasMqWN_g7-63LThHoYQALOqQnXGlHwF76fmdhe8ZU7JUkZOIoiGl9Vrh1GbC25uapyrYnTthi0awcXIaBWkZYgTtY/s320/DSC_2111.JPG" width="320" /></a></div>
<br />
Вытащил из коробки всё, что было:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-vZsZYvorNDl_mS5AY-46imkvEoCcT6iOa5aKNvozGX96Baq38LD2mdq_eXASP44mMzpQXq_cvibjYI22Bi4eL6_giXilc8k7546yrns6QFg9CDTIYt1IhCFWfk6yULJ1UnTqlyumvpw/s1600/DSC_2112.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-vZsZYvorNDl_mS5AY-46imkvEoCcT6iOa5aKNvozGX96Baq38LD2mdq_eXASP44mMzpQXq_cvibjYI22Bi4eL6_giXilc8k7546yrns6QFg9CDTIYt1IhCFWfk6yULJ1UnTqlyumvpw/s320/DSC_2112.JPG" width="320" /></a></div>
<br />
Я никогда не имел дело с проводками. Просто увидел, что тут куча разных датчиков, кнопочек, лампочек и решил не открывать пакеты до тех пор, пока мне реально что-то из этого набора не понадобится для забав.<br />
<br />
Уже почти полночь, можно до сна успеть подключить Arduino к кому и посмотреть что из этого выйдет.<br />
У меня Ubuntu 12.04. Поэтому, как советуют <a href="http://playground.arduino.cc//Linux/Ubuntu">тут</a>, поставил с консоли IDE.<br />
<br />
<pre><code>$ sudo apt-get update && sudo apt-get install arduino arduino-core</code></pre>
<br />
Пробую запустить из меню - всё ок.<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.zimagez.com/zimage/-24122013-000157.php" target="_blank" title="??????? 24.12.2013 ? 00:01:57"><img alt="??????? 24.12.2013 ? 00:01:57" src="http://www.zimagez.com/miniature/-24122013-000157.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Что дальше. Ну, наверное, надо подключить игрушку к компу. Так как меня обделили USB кабелем, то я позаимствовал кабель у принтера. Arduino от радости загорелась зелёным огоньком и замигала оранжевым. Я надеялся, что она определится как флешка и я увижу, куда можно записать код для исполнения, но нет. Придется почитать документацию.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
В IDE, как оказалось, есть готовые примеры. Иду в File/Examples/1.Basics/AnalogReadSerial. Вот текст примера. </div>
<pre><code>
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor
This example code is in the public domain.
*/
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
}</code>
</pre>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Что делает пример, разберусь потом. Сейчас попробую записать его в контроллер. Нажимаю на Upload. Получаю ошибку. </div>
<blockquote class="tr_bq">
Serial port 'COM1' not found. Did you select the right one from the Tools > Serial Port menu?</blockquote>
<div class="separator" style="clear: both; text-align: left;">
Пытаюсь следовать совету, то пункт меню "Tools/Serial port" не активен.</div>
<div class="separator" style="clear: both; text-align: left;">
Пока искал причину, <a href="http://arduino.cc/en/Tutorial/AnalogReadSerial">нашел, в чём суть</a> этого примера с быстренько собрал схему (см. первое фото, выше). Значит, будем смотреть изменение напряжения на A0.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<strike>Вот что. <a href="http://arduino.cc/en/Guide/Howto">Тут</a> говорят, что надо ставить ещё и драйвер <a href="http://www.ftdichip.com/Drivers/VCP.htm">отсюда</a>. Не помогло.</strike></div>
<div class="separator" style="clear: both; text-align: left;">
Ура! Мне помог <a href="http://robotlife.ru/arduino-ide-v-ubuntu/">Робот присутствия</a>. Сделал как он, только не перезагружался:</div>
<pre><code>$ dmesg | grep cdc_acm
[153228.248468] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[153228.254473] usbcore: registered new interface driver cdc_acm
[153228.254491] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
$ sudo chmod a+rw /dev/ttyACM0
$ sudo usermod -aG dialout <span style="color: red;"><Ваш пользователь></span>
</code></pre>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Снова делаю Upload. Сперва IDE сказала, что Serial port COM1 not found. Нажал OK, чтобы повторить попытку и это... помогло :) Done uploading</div>
<div class="separator" style="clear: both; text-align: left;">
Теперь пример залит на Arduino. Оранжевая лампа наконец-то перестала мигать и просто горит не мигая. Даже 2 лампочки.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Хорошо. Кручу переменное сопротивление, но ничего не происходит. А что должно происходить? Где посмотреть, как меняется сопротивление? В примере говорят, что смотреть надо в Serial Monitor. Ок, открыл "Tools/Serial Monitor" и вот оно!!! Работает!</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.zimagez.com/zimage/-24122013-015224.php">
<img src="http://www.zimagez.com/miniature/-24122013-015224.php" />
</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Первый пшик занял у меня аж 2 часа. Надеюсь, дальше дело пойдёт побыстрее. А теперь можно спать))</div>
</div>
Anonymoushttp://www.blogger.com/profile/07391558515801121601noreply@blogger.com0