<?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=TSL2561.begin%28%29</id>
		<title>TSL2561.begin() - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=TSL2561.begin%28%29"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=TSL2561.begin()&amp;action=history"/>
		<updated>2026-04-30T01:43:14Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=TSL2561.begin()&amp;diff=21878&amp;oldid=prev</id>
		<title>2017年7月26日 (三) 08:12 Yanglibin@microduino.cc</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=TSL2561.begin()&amp;diff=21878&amp;oldid=prev"/>
				<updated>2017-07-26T08:12:13Z</updated>
		
		<summary type="html">&lt;p&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;2017年7月26日 (三) 08:12的版本&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-l33&quot; &gt;第33行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第33行：&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;#160;&amp;#160; &amp;#160; result = tsl.begin();&amp;#160; //检测是否连接了&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;#160;&amp;#160; &amp;#160; result = tsl.begin();&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;div&gt;&amp;#160;&amp;#160; }&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;#160;&amp;#160; }&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 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;void loop() {&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;}&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;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&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&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yanglibin@microduino.cc</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=TSL2561.begin()&amp;diff=21360&amp;oldid=prev</id>
		<title>Yanglibin@microduino.cc：创建页面，内容为“{| style=&quot;width: 800px;&quot; |- | &lt;p style=&quot;color: #666666;font-size:220%&quot;&gt;'''TSL2561.begin(tslIntegrationTime,tslGain)'''&lt;/p&gt; &lt;br&gt; &lt;p style=&quot;color: #E87E05;font-size:13...”</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=TSL2561.begin()&amp;diff=21360&amp;oldid=prev"/>
				<updated>2017-07-11T09:11:55Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“{| style=&amp;quot;width: 800px;&amp;quot; |- | &amp;lt;p style=&amp;quot;color: #666666;font-size:220%&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;TSL2561.begin(tslIntegrationTime,tslGain)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt; &amp;lt;br&amp;gt; &amp;lt;p style=&amp;quot;color: #E87E05;font-size:13...”&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;
&amp;lt;p style=&amp;quot;color: #666666;font-size:220%&amp;quot;&amp;gt;'''TSL2561.begin(tslIntegrationTime,tslGain)'''&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;描述&amp;lt;/p&amp;gt;&lt;br /&gt;
开启IIC通信通讯,设置采样时间和增益。&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;参数&amp;lt;/p&amp;gt;&lt;br /&gt;
begin()里面可以不写任意参数，&amp;lt;code style=&amp;quot;color: #D45500&amp;quot;&amp;gt;tsl.begin()&amp;lt;/code&amp;gt;等同于&amp;lt;code style=&amp;quot;color: #D45500&amp;quot;&amp;gt;tsl.begin(TSL2561_INTEGRATIONTIME_13MS,TSL2561_GAIN_1X)&amp;lt;/code&amp;gt;。&lt;br /&gt;
*tslIntegrationTime，设置采样时间，默认：TSL2561_INTEGRATIONTIME_13MS，可选：&lt;br /&gt;
**TSL2561_INTEGRATIONTIME_13MS&lt;br /&gt;
**TSL2561_INTEGRATIONTIME_101MS&lt;br /&gt;
**TSL2561_INTEGRATIONTIME_402MS&lt;br /&gt;
*tslGain，设置增益，默认：TSL2561_GAIN_1X，可选：&lt;br /&gt;
**TSL2561_GAIN_1X&lt;br /&gt;
**TSL2561_GAIN_16X&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;返回值&amp;lt;/p&amp;gt;&lt;br /&gt;
bool类型，true或false。检测传感器是否连接。&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;示例&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Miroduino_TSL2561.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TSL2561 tsl;&lt;br /&gt;
&lt;br /&gt;
void setup(void)&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  bool result = tsl.begin(); //初始化光照传感器，检测是否连接了&lt;br /&gt;
&lt;br /&gt;
  while (!result) // 当没识别到光照传感器，重复检测&lt;br /&gt;
  {&lt;br /&gt;
    Serial.print(&amp;quot;Ooops, no TSL2561 detected ... Check your wiring!&amp;quot;);//串口打印警告&lt;br /&gt;
    result = tsl.begin();  //检测是否连接了&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;p style=&amp;quot;color: #E87E05;font-size:135%&amp;quot;&amp;gt;其他&amp;lt;/p&amp;gt;&lt;br /&gt;
*[[TSL2561.enableAutoGain()|enableAutoGain()]]&lt;br /&gt;
*[[TSL2561.getLuminosity()|getLuminosity()]] &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yanglibin@microduino.cc</name></author>	</entry>

	</feed>