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

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Multimeter_Simulation&amp;diff=2925&amp;oldid=prev</id>
		<title>Pkj：/* Debugging */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Multimeter_Simulation&amp;diff=2925&amp;oldid=prev"/>
				<updated>2014-06-06T08:54:14Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Debugging&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年6月6日 (五) 08:54的版本&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-l117&quot; &gt;第117行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第117行：&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;/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;−&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 3：Uploading the code and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;compiling &lt;/del&gt;successfully. &amp;#160;&lt;/div&gt;&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;Step 3：Uploading the code and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;get it compiled &lt;/ins&gt;successfully. &amp;#160;&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;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;Step 4：Finding a battery or something similar and putting it between the red and the black lines, then watching the reading on the screen. Please refer to the image above.&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;Step 4：Finding a battery or something similar and putting it between the red and the black lines, then watching the reading on the screen. Please refer to the image above.&lt;/div&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=Multimeter_Simulation&amp;diff=2919&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective==  The course will show you how to simulate a multimeter with Microduino. The reading of the “multimeter” will be displayed on Pr...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Multimeter_Simulation&amp;diff=2919&amp;oldid=prev"/>
				<updated>2014-06-06T08:14:17Z</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 simulate a multimeter with Microduino. The reading of the “multimeter” will be displayed on Pr...&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 simulate a multimeter with Microduino. The reading of the “multimeter” will be displayed on Processing.&lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
&lt;br /&gt;
*Other Equipment&lt;br /&gt;
**A USB cable &lt;br /&gt;
**A bread board&lt;br /&gt;
**A resistor of 1M Ω &lt;br /&gt;
**A resistor of 100K Ω&lt;br /&gt;
**A box of jumpers &lt;br /&gt;
&lt;br /&gt;
==Schematic Diagram==&lt;br /&gt;
&lt;br /&gt;
[[File:AnalogVoltmeterConnectionDiagram.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
The schematic diagram adopts A2 pin. There are four channels totally, corresponding to the pins of A0, A1, A2, A3 respectively.  The voltage reading will be displayed in Channel One. &lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&lt;br /&gt;
Referring to  AnalogVoltmeter&lt;br /&gt;
&lt;br /&gt;
AnalogVoltmeterProcessing&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
Step 1：Building the schematic diagram according to hardware environment, as follows: &lt;br /&gt;
[[File:AnalogVoltmeterConnection.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2：Here is  the code we need:&lt;br /&gt;
&lt;br /&gt;
The code of the two ends (Processing and Microduino)&lt;br /&gt;
Microduino:&lt;br /&gt;
&lt;br /&gt;
//The voltage value will be received by Processing via serial port output &lt;br /&gt;
  void loop()&lt;br /&gt;
  {&lt;br /&gt;
      // take a number of analog samples and add them up&lt;br /&gt;
      while (sample_count &amp;lt; NUM_SAMPLES) {&lt;br /&gt;
          // sample each channel A2 to A5&lt;br /&gt;
          for (l_cnt = 0; l_cnt &amp;lt; 4; l_cnt++) {&lt;br /&gt;
              sum[l_cnt] += analogRead(A2 + l_cnt);&lt;br /&gt;
          }&lt;br /&gt;
          sample_count++;&lt;br /&gt;
          delay(10);&lt;br /&gt;
      }&lt;br /&gt;
      // calculate the voltage for each channel&lt;br /&gt;
      for (l_cnt = 0; l_cnt &amp;lt; 4; l_cnt++) {&lt;br /&gt;
          voltage[l_cnt] = ((float)sum[l_cnt] / (float)NUM_SAMPLES * V_REF) / 1024.0;&lt;br /&gt;
      }&lt;br /&gt;
    &lt;br /&gt;
      // each voltage is multiplied by the resistor network&lt;br /&gt;
      // division factor to calculate the actual voltage&lt;br /&gt;
      voltage[0] = voltage[0] * DIV_1;&lt;br /&gt;
      voltage[1] = voltage[1] * DIV_2;&lt;br /&gt;
      voltage[2] = voltage[2] * DIV_3;&lt;br /&gt;
      voltage[3] = voltage[3] * DIV_4;&lt;br /&gt;
    &lt;br /&gt;
      // send voltages to Processing application via serial port / USB&lt;br /&gt;
      // voltage 1 - A (pin A2)&lt;br /&gt;
      Serial.print(&amp;quot;A &amp;quot;);&lt;br /&gt;
      Serial.print(voltage[0], 1);&lt;br /&gt;
      Serial.print(&amp;quot;V &amp;quot;);&lt;br /&gt;
      // voltage 2 - B (pin A3)&lt;br /&gt;
      Serial.print(&amp;quot;B &amp;quot;);&lt;br /&gt;
      Serial.print(voltage[1], 1);&lt;br /&gt;
      Serial.print(&amp;quot;V &amp;quot;);&lt;br /&gt;
      // voltge 3 - C (pin A4)&lt;br /&gt;
      Serial.print(&amp;quot;C &amp;quot;);&lt;br /&gt;
      Serial.print(voltage[2], 1);&lt;br /&gt;
      Serial.print(&amp;quot;V &amp;quot;);&lt;br /&gt;
      // voltage 4 - D (pin A5)&lt;br /&gt;
      Serial.print(&amp;quot;D &amp;quot;);&lt;br /&gt;
      Serial.print(voltage[3], 1);&lt;br /&gt;
      Serial.print(&amp;quot;V &amp;quot;);&lt;br /&gt;
      Serial.println(&amp;quot;&amp;quot;);&lt;br /&gt;
      delay(10);&lt;br /&gt;
      // reset count and sums&lt;br /&gt;
      sample_count = 0;&lt;br /&gt;
      for (l_cnt = 0; l_cnt &amp;lt; 4; l_cnt++) {&lt;br /&gt;
          sum[l_cnt] = 0;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Processing:&lt;br /&gt;
&lt;br /&gt;
//After getting the data of the first serial port &lt;br /&gt;
    println(Serial.list());&lt;br /&gt;
    // modify Serial.list()[0] to select correct serial port&lt;br /&gt;
　　 ser_port = new Serial(this, Serial.list()[0], 9600);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function Description:&lt;br /&gt;
&lt;br /&gt;
Serial Event: &lt;br /&gt;
serialEvent(Serial p)&lt;br /&gt;
&lt;br /&gt;
Displaying the channel and voltage:  &lt;br /&gt;
voltage (int channel, String volts)&lt;br /&gt;
&lt;br /&gt;
Drawing graph axis: &lt;br /&gt;
DrawGraphAxis(int pos_x, int pos_y, int width, int height)&lt;br /&gt;
&lt;br /&gt;
Drawing graph: &lt;br /&gt;
DrawGraph (String voltage, int channel, int pos_x, int pos_y, int scale)&lt;br /&gt;
&lt;br /&gt;
Drawing scale and radio box:   &lt;br /&gt;
DrawScaleSelect (int x_pos, int y_pos, int scale)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 3：Uploading the code and compiling successfully. &lt;br /&gt;
&lt;br /&gt;
Step 4：Finding a battery or something similar and putting it between the red and the black lines, then watching the reading on the screen. Please refer to the image above.&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
&lt;br /&gt;
The voltage reading of the A5 pin will be displayed in Channel Four on the screen, just as follows: &lt;br /&gt;
[[File:AnalogVoltmeterResult.jpg|600px|center|thumb]]&lt;br /&gt;
&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>