<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ro">
	<id>http://www.yo3iti.ro/index.php?action=history&amp;feed=atom&amp;title=Citire_senzor_tmp102_pentru_driver_de_termostatare</id>
	<title>Citire senzor tmp102 pentru driver de termostatare - Revizia istoricului</title>
	<link rel="self" type="application/atom+xml" href="http://www.yo3iti.ro/index.php?action=history&amp;feed=atom&amp;title=Citire_senzor_tmp102_pentru_driver_de_termostatare"/>
	<link rel="alternate" type="text/html" href="http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;action=history"/>
	<updated>2026-05-07T18:26:27Z</updated>
	<subtitle>Istoricul versiunilor pentru această pagină din wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;diff=2308&amp;oldid=prev</id>
		<title>Yo3iti la 13 aprilie 2022 22:19</title>
		<link rel="alternate" type="text/html" href="http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;diff=2308&amp;oldid=prev"/>
		<updated>2022-04-13T22:19:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 14 aprilie 2022 01:19&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-l1&quot;&gt;Linia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/del&gt;lang=&quot;python&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/ins&gt;lang=&quot;python&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import smbus&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import smbus&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&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-l173&quot;&gt;Linia 173:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 173:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return tempOut&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return tempOut&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yo3iti</name></author>
	</entry>
	<entry>
		<id>http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;diff=1410&amp;oldid=prev</id>
		<title>Yo3iti la 18 aprilie 2020 19:41</title>
		<link rel="alternate" type="text/html" href="http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;diff=1410&amp;oldid=prev"/>
		<updated>2020-04-18T19:41:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 18 aprilie 2020 22:41&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-l36&quot;&gt;Linia 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     def bytesToTemp(self, data):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     def bytesToTemp(self, data):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # Ajustare pentru extended mode&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # Ajustare pentru extended mode&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;        # vezi mai jos, def setExtendedMode&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ext = self.extractConfig(1, 4, 1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ext = self.extractConfig(1, 4, 1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         #ext = data[1] &amp;amp; 0x01&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         #ext = data[1] &amp;amp; 0x01&lt;/div&gt;&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-l101&quot;&gt;Linia 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 102:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # 0 : 0.25 Hz&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # 0 : 0.25 Hz&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # 1 : 1 Hz&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # 1 : 1 Hz&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 2 : 4 Hz (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;default&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 2 : 4 Hz (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;implicit&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # 3 : 8 Hz&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # 3 : 8 Hz&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         self.injectConfig(rate, 1, 6, 2)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         self.injectConfig(rate, 1, 6, 2)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     def setExtendedMode(self, mode):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     def setExtendedMode(self, mode):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 0 : 12-bit ( -55C &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to &lt;/del&gt;128C)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 0 : 12-bit ( &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;de la &lt;/ins&gt;-55C &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;la &lt;/ins&gt;128C)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 1 : 13-bit ( -55C &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to &lt;/del&gt;150C)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 1 : 13-bit ( &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;de la &lt;/ins&gt;-55C &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;la &lt;/ins&gt;150C)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         self.injectConfig(mode, 1, 4, 1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         self.injectConfig(mode, 1, 4, 1)&lt;/div&gt;&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-l118&quot;&gt;Linia 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 119:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     def setAlertPolarity(self, polarity):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     def setAlertPolarity(self, polarity):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 0 : &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Active &lt;/del&gt;Low&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 0 : &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Activ &lt;/ins&gt;Low&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 1 : &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Active &lt;/del&gt;High&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;         # 1 : &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Activ &lt;/ins&gt;High&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         self.injectConfig(polarity, 0, 2, 1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         self.injectConfig(polarity, 0, 2, 1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yo3iti</name></author>
	</entry>
	<entry>
		<id>http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;diff=1409&amp;oldid=prev</id>
		<title>Yo3iti: Pagină nouă: &lt;syntaxhighlight lang=&quot;python&quot;&gt; import smbus  TEMPERATURE_REG = 0x00 CONFIG_REG = 0x01 T_LOW_REG = 0x02 T_HIGH_REG = 0x03  ADDRESSES = [0x48, 0x49, 0x4A, 0x4B]  tempConvert = {...</title>
		<link rel="alternate" type="text/html" href="http://www.yo3iti.ro/index.php?title=Citire_senzor_tmp102_pentru_driver_de_termostatare&amp;diff=1409&amp;oldid=prev"/>
		<updated>2020-04-18T19:39:00Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: &amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt; import smbus  TEMPERATURE_REG = 0x00 CONFIG_REG = 0x01 T_LOW_REG = 0x02 T_HIGH_REG = 0x03  ADDRESSES = [0x48, 0x49, 0x4A, 0x4B]  tempConvert = {...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pagină nouă&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import smbus&lt;br /&gt;
&lt;br /&gt;
TEMPERATURE_REG = 0x00&lt;br /&gt;
CONFIG_REG = 0x01&lt;br /&gt;
T_LOW_REG = 0x02&lt;br /&gt;
T_HIGH_REG = 0x03&lt;br /&gt;
&lt;br /&gt;
ADDRESSES = [0x48, 0x49, 0x4A, 0x4B]&lt;br /&gt;
&lt;br /&gt;
tempConvert = {&lt;br /&gt;
    &amp;#039;C&amp;#039;: lambda x: x,&lt;br /&gt;
    &amp;#039;K&amp;#039;: lambda x: x+273.15,&lt;br /&gt;
    &amp;#039;F&amp;#039;: lambda x: x*9/5+32,&lt;br /&gt;
    &amp;#039;R&amp;#039;: lambda x: (x+273.15)*9/5&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
tempConvertInv = {&lt;br /&gt;
    &amp;#039;C&amp;#039;: lambda x: x,&lt;br /&gt;
    &amp;#039;K&amp;#039;: lambda x: x-273.15,&lt;br /&gt;
    &amp;#039;F&amp;#039;: lambda x: (x-32)*5/9,&lt;br /&gt;
    &amp;#039;R&amp;#039;: lambda x: (x*5/9)-273.15&lt;br /&gt;
}&lt;br /&gt;
class TMP102(object):&lt;br /&gt;
    def __init__(self, units=None, address=0x48, busnum=1):&lt;br /&gt;
        units = units or &amp;#039;C&amp;#039;&lt;br /&gt;
        if (address not in ADDRESSES):&lt;br /&gt;
            raise ValueError(&amp;quot;Adresă incorectă: {0:#x}&amp;quot;.format(address))&lt;br /&gt;
        self.address = address&lt;br /&gt;
        self.busnum = busnum&lt;br /&gt;
&lt;br /&gt;
        self.setUnits(units)&lt;br /&gt;
        self.bus = smbus.SMBus(self.busnum)&lt;br /&gt;
        self.readTemperature()&lt;br /&gt;
&lt;br /&gt;
    def bytesToTemp(self, data):&lt;br /&gt;
        # Ajustare pentru extended mode&lt;br /&gt;
        ext = self.extractConfig(1, 4, 1)&lt;br /&gt;
        #ext = data[1] &amp;amp; 0x01&lt;br /&gt;
        res = int((data[0] &amp;lt;&amp;lt; (4+ext)) + (data[1] &amp;gt;&amp;gt; (4-ext)))&lt;br /&gt;
&lt;br /&gt;
        if (data[0] | 0x7F is 0xFF):&lt;br /&gt;
            # 2 complement (x = x-2^bits)&lt;br /&gt;
            res = res - 4096*(2**ext)&lt;br /&gt;
        # Scrie temperatura în Celsius&lt;br /&gt;
        return res*0.0625&lt;br /&gt;
&lt;br /&gt;
    def tempToBytes(self, temp):&lt;br /&gt;
        # Temp trebuie transformată ÎNAINTE de introducere&lt;br /&gt;
        data = [0 , 0]&lt;br /&gt;
        res = int(temp/0.0625)&lt;br /&gt;
        ext = self.extractConfig(1, 4, 1)&lt;br /&gt;
        if (res &amp;lt; 0):&lt;br /&gt;
            res = res + 4096 * (2**ext)&lt;br /&gt;
        data[0] = (res &amp;gt;&amp;gt; (4 + ext)) &amp;amp; 0xFF&lt;br /&gt;
        data[1] = ((res &amp;amp; (2**(4 + ext)-1)) &amp;lt;&amp;lt; (4 - ext)) | ext&lt;br /&gt;
        return data&lt;br /&gt;
&lt;br /&gt;
    def extractConfig(self, num, location=0, length=0):&lt;br /&gt;
&lt;br /&gt;
        data = self.bus.read_i2c_block_data(self.address, CONFIG_REG, 2)&lt;br /&gt;
        if (num == 3):&lt;br /&gt;
            #dump complet de regiștri&lt;br /&gt;
            return data&lt;br /&gt;
        else:&lt;br /&gt;
            mask = 2**length - 1&lt;br /&gt;
            return (data[num] &amp;gt;&amp;gt; location) &amp;amp; mask&lt;br /&gt;
&lt;br /&gt;
    def injectConfig(self, setting, num, location, length):&lt;br /&gt;
        mask = (2**length - 1) &amp;lt;&amp;lt; location&lt;br /&gt;
        setting = (setting &amp;lt;&amp;lt; location) &amp;amp; mask&lt;br /&gt;
        data = self.bus.read_i2c_block_data(self.address, CONFIG_REG, 2)&lt;br /&gt;
        data[num] &amp;amp;= ~mask&lt;br /&gt;
        data[num] |= setting&lt;br /&gt;
        self.bus.write_i2c_block_data(self.address, CONFIG_REG, data)&lt;br /&gt;
&lt;br /&gt;
    def readTemperature(self, units=None):&lt;br /&gt;
        data = self.bus.read_i2c_block_data(self.address, TEMPERATURE_REG, 2)&lt;br /&gt;
        tempC = self.bytesToTemp(data)&lt;br /&gt;
        units = units or self.units&lt;br /&gt;
&lt;br /&gt;
        try:&lt;br /&gt;
            tempOut = tempConvert[units](tempC)&lt;br /&gt;
        except:&lt;br /&gt;
            raise ValueError(&amp;#039;Unități nevalide &amp;quot;&amp;#039; + self.units + &amp;#039;&amp;quot;&amp;#039;)&lt;br /&gt;
        return tempOut&lt;br /&gt;
&lt;br /&gt;
    def getUnits(self):&lt;br /&gt;
        return self.units&lt;br /&gt;
&lt;br /&gt;
    def setUnits(self, units):&lt;br /&gt;
        if (units.upper() in &amp;#039;RCKF&amp;#039; and len(units) == 1):&lt;br /&gt;
            self.units = units.upper()&lt;br /&gt;
        else:&lt;br /&gt;
            raise ValueError(&amp;quot;Unități nevalide, trebuie utilizat C(elsius), K(elvin),&amp;quot;&lt;br /&gt;
                    &amp;quot;F(ahrenheit), sau R(ankine)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def setConversionRate(self, rate):&lt;br /&gt;
        # 0 : 0.25 Hz&lt;br /&gt;
        # 1 : 1 Hz&lt;br /&gt;
        # 2 : 4 Hz (default)&lt;br /&gt;
        # 3 : 8 Hz&lt;br /&gt;
        self.injectConfig(rate, 1, 6, 2)&lt;br /&gt;
&lt;br /&gt;
    def setExtendedMode(self, mode):&lt;br /&gt;
        # 0 : 12-bit ( -55C to 128C)&lt;br /&gt;
        # 1 : 13-bit ( -55C to 150C)&lt;br /&gt;
&lt;br /&gt;
        self.injectConfig(mode, 1, 4, 1)&lt;br /&gt;
&lt;br /&gt;
    def sleep(self):&lt;br /&gt;
        self.injectConfig(True, 0, 0, 1)&lt;br /&gt;
&lt;br /&gt;
    def wakeup(self):&lt;br /&gt;
        self.injectConfig(False, 0, 0, 1)&lt;br /&gt;
&lt;br /&gt;
    def setAlertPolarity(self, polarity):&lt;br /&gt;
        # 0 : Active Low&lt;br /&gt;
        # 1 : Active High&lt;br /&gt;
        self.injectConfig(polarity, 0, 2, 1)&lt;br /&gt;
&lt;br /&gt;
    def alert(self):&lt;br /&gt;
        return extractConfig(1, 5, 1)&lt;br /&gt;
&lt;br /&gt;
    def setFault(self, faultSetting):&lt;br /&gt;
        # 0 : 1 eroare&lt;br /&gt;
        # 1 : 2 erori&lt;br /&gt;
        # 2 : 4 erori&lt;br /&gt;
        # 3 : 6 erori&lt;br /&gt;
        self.injectConfig(faultSetting, 0, 3, 2)&lt;br /&gt;
&lt;br /&gt;
    def setAlertMode(self, mode):&lt;br /&gt;
        # 0 : Mode comparator (Activ în interiorul ecartului de temperatură)&lt;br /&gt;
        # 1 : Mod termostat (Activ dacă e peste T_High, reset la citire)&lt;br /&gt;
        self.injectConfig(mode, 0, 1, 1)&lt;br /&gt;
&lt;br /&gt;
    def setBoundTemp(self, upper, temperature, units=None):&lt;br /&gt;
        units = units or self.units&lt;br /&gt;
        ext = self.extractConfig(1, 4, 1)&lt;br /&gt;
        try:&lt;br /&gt;
            temperature = tempConvertInv[units](temperature)&lt;br /&gt;
        except:&lt;br /&gt;
            raise ValueError(&amp;#039;Unități nevalide &amp;quot;&amp;#039; + self.units + &amp;#039;&amp;quot;&amp;#039;)&lt;br /&gt;
        if (ext is 1 and temperature &amp;gt; 150):&lt;br /&gt;
            temperature = 150&lt;br /&gt;
        elif (temperature &amp;lt; -55):&lt;br /&gt;
            temperature = -55&lt;br /&gt;
        data = self.tempToBytes(temperature)&lt;br /&gt;
&lt;br /&gt;
        if (upper):&lt;br /&gt;
            reg = T_HIGH_REG&lt;br /&gt;
        else:&lt;br /&gt;
            reg = T_LOW_REG&lt;br /&gt;
&lt;br /&gt;
        self.bus.write_i2c_block_data(self.address, reg, data)&lt;br /&gt;
&lt;br /&gt;
    def getBoundTemp(self, upper, units=None):&lt;br /&gt;
        units = units or self.units&lt;br /&gt;
        if (upper):&lt;br /&gt;
            reg = T_HIGH_REG&lt;br /&gt;
        else:&lt;br /&gt;
            reg = T_LOW_REG&lt;br /&gt;
        data = self.bus.read_i2c_block_data(self.address, reg, 2)&lt;br /&gt;
        tempC = self.bytesToTemp(data)&lt;br /&gt;
&lt;br /&gt;
        try:&lt;br /&gt;
            tempOut = tempConvert[units](tempC)&lt;br /&gt;
        except:&lt;br /&gt;
            raise ValueError(&amp;#039;Unități nevalide &amp;quot;&amp;#039; + self.units + &amp;#039;&amp;quot;&amp;#039;)&lt;br /&gt;
        return tempOut&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yo3iti</name></author>
	</entry>
</feed>