<?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_17--Microduino_Button_Control_Digital_Tube</id>
		<title>Lesson 17--Microduino Button Control Digital Tube - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Lesson_17--Microduino_Button_Control_Digital_Tube"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_17--Microduino_Button_Control_Digital_Tube&amp;action=history"/>
		<updated>2026-04-21T14:42:42Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Lesson_17--Microduino_Button_Control_Digital_Tube&amp;diff=1669&amp;oldid=prev</id>
		<title>Pkj：/* Program */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_17--Microduino_Button_Control_Digital_Tube&amp;diff=1669&amp;oldid=prev"/>
				<updated>2014-03-29T08:15:18Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Program&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2014年3月29日 (六) 08:15的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot; &gt;第48行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第48行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Program==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Program==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Download program:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced/MicroduinoDigitalSubtraction&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Lesson_17--Microduino_Button_Control_Digital_Tube&amp;diff=1408&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{{Language | 第十七课--Microduino 独立按键让数码管加减}} {| style=&quot;width: 800px;&quot; |- | ==Objective==  This tutorial will teach you how to use the buttons to add ...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_17--Microduino_Button_Control_Digital_Tube&amp;diff=1408&amp;oldid=prev"/>
				<updated>2014-03-12T12:47:49Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Language | 第十七课--Microduino 独立按键让数码管加减}} {| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective==  This tutorial will teach you how to use the buttons to add ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Language | 第十七课--Microduino 独立按键让数码管加减}}&lt;br /&gt;
{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
This tutorial will teach you how to use the buttons to add and subtract the digital tube displayed value. There are two buttons, one is used to increase the value, another is used to decrease value.&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;
**Digital tube                 one&lt;br /&gt;
**Buttos                       two&lt;br /&gt;
**220Ω (100Ω~1kΩ)              one &lt;br /&gt;
**USB Data cable               one&lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
[[File:第十七课-Microduino独立按键让数码管加减原理图.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
Pin Table&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Microduino Pin !! Digital Tube Pin&lt;br /&gt;
|-&lt;br /&gt;
| D10 || 1&lt;br /&gt;
|-&lt;br /&gt;
| D9 || 2&lt;br /&gt;
|-&lt;br /&gt;
| D5 || 3&lt;br /&gt;
|-&lt;br /&gt;
| D8 || 4&lt;br /&gt;
|-&lt;br /&gt;
| D13 || 5&lt;br /&gt;
|-&lt;br /&gt;
| D7 || 6&lt;br /&gt;
|-&lt;br /&gt;
| D6 || 7&lt;br /&gt;
|-&lt;br /&gt;
| Not used || 8&lt;br /&gt;
|-&lt;br /&gt;
| D11 || 9&lt;br /&gt;
|-&lt;br /&gt;
| D12 || 10&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;
    #include &amp;quot;SevSeg.h&amp;quot;&lt;br /&gt;
    SevSeg sevseg;&lt;br /&gt;
    int i=5;&lt;br /&gt;
    &lt;br /&gt;
    void setup() {&lt;br /&gt;
    //Define used pins&lt;br /&gt;
      sevseg.Begin(1,2,3,4,5,6,7,8,9,10,11,12,13);&lt;br /&gt;
      pinMode(2, INPUT);    //D2 use to add&lt;br /&gt;
      pinMode(3, INPUT);    //D3 use to subtract&lt;br /&gt;
      &lt;br /&gt;
      sevseg.PrintOutput();&lt;br /&gt;
      sevseg.NewNum(i, 4); &lt;br /&gt;
      &lt;br /&gt;
    }&lt;br /&gt;
     &lt;br /&gt;
    void loop() {&lt;br /&gt;
      //Enable the output function&lt;br /&gt;
      sevseg.PrintOutput();&lt;br /&gt;
&lt;br /&gt;
      if(digitalRead(2)==HIGH) {//If press button 2&lt;br /&gt;
        i++;&lt;br /&gt;
        sevseg.NewNum(i, 4);&lt;br /&gt;
        delay(200);        //Delay 50ms&lt;br /&gt;
      }&lt;br /&gt;
      else if(digitalRead(3)==HIGH) {//If press button 3&lt;br /&gt;
        i--;&lt;br /&gt;
        sevseg.NewNum(i, 4);&lt;br /&gt;
        delay(200);        //Delay 50ms&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debug==&lt;br /&gt;
Fristly download the library, uncompress it and put to libraries folder of Arduino IDE, then restart Arduino IDE to load library.&lt;br /&gt;
&lt;br /&gt;
Library link：https://docs.google.com/file/d/0Bwrp4uluZCpNN1Q4dmFZX1MzWVE/edit&lt;br /&gt;
&lt;br /&gt;
This library can drive 4bits digital tube and support number, decimal point and easy to use.&lt;br /&gt;
&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;
&lt;br /&gt;
[[File:第十七课-Microduino独立按键让数码管加减连接图.jpg|600px|center|thumb]]&lt;br /&gt;
There are two buttons and use the same connection. One end connects to power and on the other end, a signal line and GND in parallel.&lt;br /&gt;
&lt;br /&gt;
Step 3：Run program&lt;br /&gt;
&lt;br /&gt;
Step 4：Digital displays initial value 5, then press that two buttons respectively, what will happen!!&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
&lt;br /&gt;
Press two buttons respectively, the value will increase one or decrease one.&lt;br /&gt;
&lt;br /&gt;
==Video==&lt;br /&gt;
&lt;br /&gt;
http://v.youku.com/v_show/id_XNjc2ODQ3NDM2.html&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>