<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to use SAADC example on nrf52832 with Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63133/how-to-use-saadc-example-on-nrf52832-with-zephyr</link><description>Hi guys, 
 I am using the Nordic nrf52832 board for my project. One of my goals is to enable the device to read the voltage from the external source. I have already found an SAADC example where they implemented this function, but now I have some questions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Jun 2020 12:46:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63133/how-to-use-saadc-example-on-nrf52832-with-zephyr" /><item><title>RE: How to use SAADC example on nrf52832 with Zephyr</title><link>https://devzone.nordicsemi.com/thread/257385?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 12:46:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b89da009-bb76-432c-8a8c-c9753c15efaf</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;P0.11 can&amp;#39;t be used for the ADC:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pin.html#qfn48"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pin.html#qfn48&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You need to use a pin that is labeled with AIN*&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use SAADC example on nrf52832 with Zephyr</title><link>https://devzone.nordicsemi.com/thread/257361?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 12:01:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:405bb80d-2da5-4861-ab90-16b170854c41</guid><dc:creator>Aduka_27</dc:creator><description>&lt;p&gt;Thanks a lot. I will take a look and try to find some solution. Also, related to this temperature sensor I found this defined example what do you think about that. I connected the sensor to my device using (VDD, GND and P0.11 pins), but I got some weird results for temperature and humidity. What do you suggest me here, maybe I missed this analog pin (P0.11)?? Thanks in advance!! &lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2019 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;device.h&amp;gt;
#include &amp;lt;drivers/sensor.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

static const char *now_str(void)
{
	static char buf[16]; /* ...HH:MM:SS.MMM */
	u32_t now = k_uptime_get_32();
	unsigned int ms = now % MSEC_PER_SEC;
	unsigned int s;
	unsigned int min;
	unsigned int h;

	now /= MSEC_PER_SEC;
	s = now % 60U;
	now /= 60U;
	min = now % 60U;
	now /= 60U;
	h = now;

	snprintf(buf, sizeof(buf), &amp;quot;%u:%02u:%02u.%03u&amp;quot;,
		 h, min, s, ms);
	return buf;
}

void main(void)
{
	const char *const label = DT_LABEL(DT_INST(0, aosong_dht));
	struct device *dht22 = device_get_binding(label);

	if (!dht22) {
		printf(&amp;quot;Failed to find sensor %s\n&amp;quot;, label);
		return;
	}

	while (true) {
		int rc = sensor_sample_fetch(dht22);

		if (rc != 0) {
			printf(&amp;quot;Sensor fetch failed: %d\n&amp;quot;, rc);
			break;
		}

		struct sensor_value temperature;
		struct sensor_value humidity;

		rc = sensor_channel_get(dht22, SENSOR_CHAN_AMBIENT_TEMP,
					&amp;amp;temperature);
		if (rc == 0) {
			rc = sensor_channel_get(dht22, SENSOR_CHAN_HUMIDITY,
						&amp;amp;humidity);
		}
		if (rc != 0) {
			printf(&amp;quot;get failed: %d\n&amp;quot;, rc);
			break;
		}

		printf(&amp;quot;[%s]: %.1f Cel ; %.1f %%RH\n&amp;quot;,
		       now_str(),
		       sensor_value_to_double(&amp;amp;temperature),
		       sensor_value_to_double(&amp;amp;humidity));
		k_sleep(K_SECONDS(2));
	}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use SAADC example on nrf52832 with Zephyr</title><link>https://devzone.nordicsemi.com/thread/257357?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 11:55:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26e0d7ab-cc86-4831-b26e-7185b5583e96</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The code you reference won&amp;#39;t work. I could find someone have made an ADC example here:&lt;br /&gt;&lt;a href="https://medium.com/home-wireless/reading-analog-data-in-zephyr-with-a-nrf52840-e05dae326b9b"&gt;https://medium.com/home-wireless/reading-analog-data-in-zephyr-with-a-nrf52840-e05dae326b9b&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>