﻿<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://www.yfrobot.com.cn/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
		<id>https://www.yfrobot.com.cn/wiki/index.php?action=history&amp;feed=atom&amp;title=RandomSeed%28%29</id>
		<title>RandomSeed() - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="https://www.yfrobot.com.cn/wiki/index.php?action=history&amp;feed=atom&amp;title=RandomSeed%28%29"/>
		<link rel="alternate" type="text/html" href="https://www.yfrobot.com.cn/wiki/index.php?title=RandomSeed()&amp;action=history"/>
		<updated>2026-04-08T09:33:41Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.22.6</generator>

	<entry>
		<id>https://www.yfrobot.com.cn/wiki/index.php?title=RandomSeed()&amp;diff=1707&amp;oldid=prev</id>
		<title>2017年9月13日 (三) 06:09 Allblue</title>
		<link rel="alternate" type="text/html" href="https://www.yfrobot.com.cn/wiki/index.php?title=RandomSeed()&amp;diff=1707&amp;oldid=prev"/>
				<updated>2017-09-13T06:09:59Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2017年9月13日 (三) 06:09的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第47行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第47行：&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;:- [[random()]]&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;:- [[random()]]&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 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;/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;----&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;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Allblue</name></author>	</entry>

	<entry>
		<id>https://www.yfrobot.com.cn/wiki/index.php?title=RandomSeed()&amp;diff=1706&amp;oldid=prev</id>
		<title>Allblue：以“&lt;font color=&quot;orange&quot; size=&quot;+1&quot;&gt;'''描述'''&lt;/font&gt;  randomSeed()初始化伪随机数生成器，使其从随机序列中的任意点开始。 这个序列，虽然...”为内容创建页面</title>
		<link rel="alternate" type="text/html" href="https://www.yfrobot.com.cn/wiki/index.php?title=RandomSeed()&amp;diff=1706&amp;oldid=prev"/>
				<updated>2017-09-13T06:09:31Z</updated>
		
		<summary type="html">&lt;p&gt;以“&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;描述&amp;#039;&amp;#039;&amp;#039;&amp;lt;/font&amp;gt;  randomSeed()初始化伪随机数生成器，使其从随机序列中的任意点开始。 这个序列，虽然...”为内容创建页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;'''描述'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
randomSeed()初始化伪随机数生成器，使其从随机序列中的任意点开始。 这个序列，虽然很长，随机，总是一样的。&lt;br /&gt;
&lt;br /&gt;
如果对随机生成的值序列是重要的，则在随后的草图执行中，使用randomSeed()来初始化随机数生成器，该引擎具有相当随机的输入，例如未连接引脚上的analogRead()。&lt;br /&gt;
&lt;br /&gt;
相反，使用准确重复的伪随机序列偶尔也是有用的。 这可以通过在开始随机序列之前调用具有固定数字的randomSeed()来实现。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;'''语法'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:dimgray&amp;quot;&amp;gt;&lt;br /&gt;
randomSeed(seed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;'''参数'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* long,int - 通过数字生成种子。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;'''返回'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* none&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;'''示例'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:dimgray&amp;quot;&amp;gt;&lt;br /&gt;
long randNumber;&lt;br /&gt;
&lt;br /&gt;
void setup(){&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  randomSeed(analogRead(0));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop(){&lt;br /&gt;
  randNumber = random(300);&lt;br /&gt;
  Serial.println(randNumber);&lt;br /&gt;
&lt;br /&gt;
  delay(50);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot; size=&amp;quot;+1&amp;quot;&amp;gt;'''扩展阅读'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:- [[random()]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Arduino语法参考 | 返回Arduino语法参考列表]]&lt;br /&gt;
&lt;br /&gt;
更多建议和问题欢迎反馈至 [http://www.yfrobot.com YFRobot论坛]&lt;/div&gt;</summary>
		<author><name>Allblue</name></author>	</entry>

	</feed>