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

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Digital_Tube_Control&amp;diff=2998&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective==  The course will show you how to use Processing to control a common cathode digital tube.   ==Equipment== *'''Microduino-Core''...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Digital_Tube_Control&amp;diff=2998&amp;oldid=prev"/>
				<updated>2014-06-13T03:51:43Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective==  The course will show you how to use Processing to control a common cathode digital tube.   ==Equipment== *&amp;#039;&amp;#039;&amp;#039;&lt;a href=&quot;/index.php/Microduino-Core&quot; title=&quot;Microduino-Core&quot;&gt;Microduino-Core&lt;/a&gt;&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
The course will show you how to use Processing to control a common cathode digital tube. &lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Other Hardware Equipment&lt;br /&gt;
**A USB cable&lt;br /&gt;
**A common cathode digital tube  &lt;br /&gt;
**A box of jumpers  &lt;br /&gt;
**A resistor of 10K Ω  &lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
&lt;br /&gt;
[[File:processing7SegmentSchematics.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&lt;br /&gt;
https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/ProcessingSegment&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
Step 1：Build the hardware environment according to the schematic, just like this：&lt;br /&gt;
[[File:processing7SegmentConnectionDiagram.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2: Here is the code needed:&lt;br /&gt;
&lt;br /&gt;
The code the two ends(Processing and Microduino) &lt;br /&gt;
&lt;br /&gt;
Microduino:&lt;br /&gt;
&lt;br /&gt;
Using Firmata's StandardFirmata program. &lt;br /&gt;
&lt;br /&gt;
Processing:&lt;br /&gt;
&lt;br /&gt;
//Define eight led lights to indicate a digital tube. &lt;br /&gt;
  LED[] leds = new LED[8]; // An array of 8 led objects!&lt;br /&gt;
&lt;br /&gt;
//Define Microduino pins of the corresponding digital tube pins (1,2...10).  &lt;br /&gt;
  int microduinoPins[] = {//Correspondence microduino pin for 7 segment &lt;br /&gt;
    11,2,4,5,6,7,9,10};&lt;br /&gt;
&lt;br /&gt;
//Define the name of each segment LED digital tube  &lt;br /&gt;
  String segmentLables[]={&amp;quot;1-e&amp;quot;,&amp;quot;2-d&amp;quot;,&amp;quot;3-c&amp;quot;,&amp;quot;4-dp&amp;quot;,&amp;quot;5-b&amp;quot;,&amp;quot;6-a&amp;quot;,&amp;quot;7-f&amp;quot;,&amp;quot;8-g&amp;quot;};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Initialize and draw each led in setup(). &lt;br /&gt;
  for (int i = 0; i &amp;lt; leds.length; i ++ ) { // Initialize each led and output pin using a for loop.&lt;br /&gt;
    arduino.pinMode(microduinoPins[i], Arduino.OUTPUT); &lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  leds[0] = new LED(50, 350, 50,200,1);&lt;br /&gt;
  leds[1] = new LED(100, 550, 200,50,2);&lt;br /&gt;
  leds[2] = new LED(300, 350, 50,200,3);&lt;br /&gt;
  leds[3] = new LED(350, 550, 50,50,4);&lt;br /&gt;
  leds[4] = new LED(300, 100, 50,200,5);&lt;br /&gt;
  leds[5] = new LED(100, 50, 200,50,6);&lt;br /&gt;
  leds[6] = new LED(50, 100, 50,200,7);&lt;br /&gt;
  leds[7] = new LED(100, 300, 200,50,8);&lt;br /&gt;
&lt;br /&gt;
//Draw the digital tube in draw(), judge the status of the led lights, and send the current status to Microduino   &lt;br /&gt;
  for (int i = 0; i &amp;lt; leds.length; i ++ ) { // Run each Car using a for loop.&lt;br /&gt;
    leds[i].display();&lt;br /&gt;
    &lt;br /&gt;
    //draw segemnt lables&lt;br /&gt;
    text (segmentLables[i], leds[i].xpos, leds[i].ypos); &lt;br /&gt;
    &lt;br /&gt;
    if (leds[i].button) {//switch led on/off&lt;br /&gt;
      arduino.digitalWrite(microduinoPins[i], Arduino.HIGH);&lt;br /&gt;
    }&lt;br /&gt;
    else {&lt;br /&gt;
      arduino.digitalWrite(microduinoPins[i], Arduino.LOW);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Step 3：Download the code and get it compiled successfully. &lt;br /&gt;
&lt;br /&gt;
Step 4：There will appear eight led lights in Processing after the system goes smoothly. Please click each led and see the response of the digital tube. &lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
&lt;br /&gt;
Click the mouse and the corresponding digital tube led will turn on or off, as follows: &lt;br /&gt;
[[File:processing7SegmentResult1.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Video==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>