<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Lesson_30--Microduino_8%2A8_Lattice_Animated_Emoticon</id>
		<title>Lesson 30--Microduino 8*8 Lattice Animated Emoticon - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Lesson_30--Microduino_8%2A8_Lattice_Animated_Emoticon"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_30--Microduino_8*8_Lattice_Animated_Emoticon&amp;action=history"/>
		<updated>2026-06-06T07:24:25Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Lesson_30--Microduino_8*8_Lattice_Animated_Emoticon&amp;diff=1499&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{{Language|第三十课--Microduino8*8点阵动画表情制作}} {| style=&quot;width: 800px;&quot; |- | ==Objective== This tutorial will teach you display a changeing smiling face base...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_30--Microduino_8*8_Lattice_Animated_Emoticon&amp;diff=1499&amp;oldid=prev"/>
				<updated>2014-03-19T12:21:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Language|第三十课--Microduino8*8点阵动画表情制作}} {| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective== This tutorial will teach you display a changeing smiling face base...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Language|第三十课--Microduino8*8点阵动画表情制作}}&lt;br /&gt;
{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Objective==&lt;br /&gt;
This tutorial will teach you display a changeing smiling face based on the static one.&lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
*Other hardware equipment&lt;br /&gt;
**Breadboard Jumper            one box   &lt;br /&gt;
**Breadboard  	               one piece  &lt;br /&gt;
**8*8 lattice                  one&lt;br /&gt;
**74HC595                      Two&lt;br /&gt;
**USB cable                    one&lt;br /&gt;
&lt;br /&gt;
'''8*8 lattice LED is：LD-1088BS, the following is its pin definition：'''&lt;br /&gt;
[[File:第三十课-8_8点阵引脚定义.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
[[File:第三十课-Microduino8_8点阵动作表情原理图.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pin Table：&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Lattice ROW !! Lattice 16pin !! 74HC595 !! 74HC595&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 13 || 15 || Q0&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 3 || 1 || Q1&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 4 || 2 || Q2&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 10 || 3 || Q3&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 6 || 4 || Q4&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 11 || 5 || Q5&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 15 || 6 || Q6&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 16 || 7 || Q7&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Lattice COL !! Lattice 16pin !! 74HC595 !! 74HC595&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 5 || 15 || Q0&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 2 || 1 || Q1&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 7 || 2 || Q2&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 1 || 3 || Q3&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 12 || 4 || Q4&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 8 || 5 || Q5&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 14 || 6 || Q6&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 9 || 7 || Q7&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Connect to 74HC595的ST_CP&lt;br /&gt;
int latchPin = 8;&lt;br /&gt;
//Connect to 74HC595的SH_CP&lt;br /&gt;
int clockPin = 12;&lt;br /&gt;
//Connect to 74HC595的DS&lt;br /&gt;
int dataPin = 11;&lt;br /&gt;
&lt;br /&gt;
//Set the timer&lt;br /&gt;
unsigned long time;&lt;br /&gt;
&lt;br /&gt;
//Hide line definition&lt;br /&gt;
byte masks[8]={&lt;br /&gt;
  B01111111,B10111111,B11011111,B11101111,B11110111,B11111011,B11111101,B11111110};&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
  //Action definition for smiling face &lt;br /&gt;
byte rows[2][8]={&lt;br /&gt;
  {&lt;br /&gt;
    B00111100,B01000010,B10100101,B10000001,B10100101,B10011001,B01000010,B00111100  }&lt;br /&gt;
  ,&lt;br /&gt;
  {&lt;br /&gt;
    B00111100,B01000010,B10100101,B10000001,B10111101,B10000001,B01000010,B00111100  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  //Baud rate 9600         &lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  //Set latchpin as output&lt;br /&gt;
  pinMode(latchPin, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
&lt;br /&gt;
  //Action change&lt;br /&gt;
  for(int j=0;j&amp;lt;2;j++) {&lt;br /&gt;
&lt;br /&gt;
    unsigned long startTime = millis();&lt;br /&gt;
    for (unsigned long elapsed=0; elapsed &amp;lt; 1000; elapsed = millis() - startTime) {//Display 600ms&lt;br /&gt;
      for(int i=0;i&amp;lt;8;i++) {&lt;br /&gt;
        digitalWrite(latchPin, 0);&lt;br /&gt;
        shiftOut(dataPin, clockPin, masks[i]);  //mask(col)&lt;br /&gt;
        shiftOut(dataPin, clockPin, rows[j][i]);  //row&lt;br /&gt;
        digitalWrite(latchPin, 1);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    //time=0;&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void shiftOut(int myDataPin, int myClockPin, byte myDataOut) {&lt;br /&gt;
  // This shifts 8 bits out MSB first,&lt;br /&gt;
  //on the rising edge of the clock,&lt;br /&gt;
  //clock idles low&lt;br /&gt;
&lt;br /&gt;
  //internal function setup&lt;br /&gt;
  int i=0;&lt;br /&gt;
  int pinState;&lt;br /&gt;
  pinMode(myClockPin, OUTPUT);&lt;br /&gt;
  pinMode(myDataPin, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
  //clear everything out just in case to&lt;br /&gt;
  //prepare shift register for bit shifting&lt;br /&gt;
  digitalWrite(myDataPin, 0);&lt;br /&gt;
  digitalWrite(myClockPin, 0);&lt;br /&gt;
&lt;br /&gt;
  //for each bit in the byte myDataOut&amp;amp;#239;&amp;amp;#191;&amp;amp;#189;&lt;br /&gt;
  //NOTICE THAT WE ARE COUNTING DOWN in our for loop&lt;br /&gt;
  //This means that %00000001 or &amp;quot;1&amp;quot; will go through such&lt;br /&gt;
  //that it will be pin Q0 that lights.&lt;br /&gt;
  for (i=7; i&amp;gt;=0; i--)  {&lt;br /&gt;
    digitalWrite(myClockPin, 0);&lt;br /&gt;
&lt;br /&gt;
    //if the value passed to myDataOut and a bitmask result&lt;br /&gt;
    // true then... so if we are at i=6 and our value is&lt;br /&gt;
    // %11010100 it would the code compares it to %01000000&lt;br /&gt;
    // and proceeds to set pinState to 1.&lt;br /&gt;
    if ( myDataOut &amp;amp; (1&amp;lt;&amp;lt;i) ) {&lt;br /&gt;
      pinState= 1;&lt;br /&gt;
    }&lt;br /&gt;
    else {       &lt;br /&gt;
      pinState= 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //Sets the pin to HIGH or LOW depending on pinState&lt;br /&gt;
    digitalWrite(myDataPin, pinState);&lt;br /&gt;
    //register shifts bits on upstroke of clock pin  &lt;br /&gt;
    digitalWrite(myClockPin, 1);&lt;br /&gt;
    //zero the data pin after shift to prevent bleed through&lt;br /&gt;
    digitalWrite(myDataPin, 0);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //stop shifting&lt;br /&gt;
  digitalWrite(myClockPin, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define two expression in rows[2][8].&lt;br /&gt;
&lt;br /&gt;
==Debug==&lt;br /&gt;
Step 1：Copy the code to IDE and compile it&lt;br /&gt;
&lt;br /&gt;
Step 2：Set up circuit, as follows：&lt;br /&gt;
[[File:第三十课-Microduino8_8点阵动作表情连接图.jpg|600px|center|thumb]]&lt;br /&gt;
In order to protect the circuit, plus a 220Ω registor on the every connection line (total 8 lines) between one 74HC595 chip and 8*8 latteice LED. In our example, we don't use the registor, so the LED's brightnees is strong. If  the lattice's quality is bad and easily broken. &lt;br /&gt;
&lt;br /&gt;
Step 3：Run program&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
The expression will be changed on 8*8 8*8 lattice LED&lt;br /&gt;
==Video==&lt;br /&gt;
http://v.youku.com/v_show/id_XNjg2MDQ4ODQw.html&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>