<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Temperature sensor with CORE2 AWS]]></title><description><![CDATA[<p dir="auto">Im using Grove - Temperature Sensor V1.2 with M5Stack AWS Edu kit,...im using the same example code given by seeeds wiki. It perfectly worked with my arduino.. But in m5stack it gives nan, and the raw values are 3400.00,3900.66 likes this, can anyone help me to resolve this...<br />
.................................Code.....................................<br />
// Demo code for Grove - Temperature Sensor V1.1/1.2<br />
// Loovee @ 2015-8-26</p>
<p dir="auto">#include &lt;math.h&gt;</p>
<p dir="auto">const int B = 4275;               // B value of the thermistor<br />
const int R0 = 100000;            // R0 = 100k<br />
const int pinTempSensor = A0;     // Grove - Temperature Sensor connect to A0</p>
<p dir="auto">#if defined(ARDUINO_ARCH_AVR)<br />
#define debug  Serial<br />
#elif defined(ARDUINO_ARCH_SAMD) ||  defined(ARDUINO_ARCH_SAM)<br />
#define debug  SerialUSB<br />
#else<br />
#define debug  Serial<br />
#endif</p>
<p dir="auto">void setup()<br />
{<br />
Serial.begin(9600);<br />
}</p>
<p dir="auto">void loop()<br />
{<br />
int a = analogRead(pinTempSensor);</p>
<pre><code>float R = 1023.0/a-1.0;
R = R0*R;

float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15; // convert to temperature via datasheet

Serial.print("temperature = ");
Serial.println(temperature);

delay(100);
</code></pre>
<p dir="auto">}<br />
................................................................................</p>
]]></description><link>https://community.m5stack.com/topic/3438/temperature-sensor-with-core2-aws</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 00:11:02 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3438.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Jul 2021 06:21:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Temperature sensor with CORE2 AWS on Tue, 20 Jul 2021 23:03:36 GMT]]></title><description><![CDATA[<p dir="auto">Hi Pradeep, different hardware will have different pin assignments. Your sensor should be connected to Port B if it's using the ADC and <code>pinTempSensor</code> should be set to pin 36.</p>
]]></description><link>https://community.m5stack.com/post/14449</link><guid isPermaLink="true">https://community.m5stack.com/post/14449</guid><dc:creator><![CDATA[rashedtalukder]]></dc:creator><pubDate>Tue, 20 Jul 2021 23:03:36 GMT</pubDate></item></channel></rss>