<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>Average bulk samples from Data Acquisition Board for Pi Pico with C++ STL</title><link>/products/raspberry-pi/raspberrypi_projects/b/blog/posts/average-bulk-samples-from-data-acquisition-board-for-pi-pico-with-c-stl</link><description>shabaz designed a Data Acquisition Board for Pi Pico . In the previous post , I used it in continuous sample mode. I took 1 second worth of samples, in 860 samples per second mode.
In this post, I average those samp...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Average bulk samples from Data Acquisition Board for Pi Pico with C++ STL</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/average-bulk-samples-from-data-acquisition-board-for-pi-pico-with-c-stl</link><pubDate>Thu, 14 Dec 2023 22:27:54 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:826761f3-c423-4c2c-959d-a0a92bbe9ad9</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Create an array of voltages (double) from an array of samples (uint16_t):&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3f0f6331-fb3a-480d-b64b-fcf8c4b0e883:type=c_cpp&amp;text=%20%20%20%20%2F%2F%20convert%20every%20value%20to%20voltage%0A%20%20%20%20double%20volts%5BSAMPLES%5D%3B%0A%20%20%20%20std%3A%3Atransform%28std%3A%3Abegin%28buf%29%2C%20std%3A%3Aend%28buf%29%2C%20std%3A%3Abegin%28volts%29%2C%0A%20%20%20%20%20%20%20%20%5B%5D%28uint16_t%20u%29%7B%20return%20to_volts%28BOARD0%2C%200%2C%20u%29%3B%20%7D%29%3B]&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=27329&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Average bulk samples from Data Acquisition Board for Pi Pico with C++ STL</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/average-bulk-samples-from-data-acquisition-board-for-pi-pico-with-c-stl</link><pubDate>Tue, 12 Dec 2023 20:33:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:826761f3-c423-4c2c-959d-a0a92bbe9ad9</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update Jan.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=27329&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Average bulk samples from Data Acquisition Board for Pi Pico with C++ STL</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/average-bulk-samples-from-data-acquisition-board-for-pi-pico-with-c-stl</link><pubDate>Tue, 12 Dec 2023 15:10:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:826761f3-c423-4c2c-959d-a0a92bbe9ad9</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Jan,&lt;/p&gt;
&lt;p&gt;Very neat, STL is an elegant problem-solver. I&amp;#39;ve not used std::accumulate before (I&amp;#39;m familiar with a subset of STL, and I recall what a complete mystery it was at the start of learning C++!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=27329&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Average bulk samples from Data Acquisition Board for Pi Pico with C++ STL</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/average-bulk-samples-from-data-acquisition-board-for-pi-pico-with-c-stl</link><pubDate>Tue, 12 Dec 2023 15:09:23 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:826761f3-c423-4c2c-959d-a0a92bbe9ad9</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The array could be printed like this:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:1e6deca9-77ae-4d7b-9e4a-999c8918e9f5:type=c_cpp&amp;text=%20%20%20%20%2F%2F%20print%20voltage%0D%0A%20%20%20%20std%3A%3Afor_each%28std%3A%3Abegin%28buf%29%2C%20std%3A%3Aend%28buf%29%2C%20%5B%5D%28uint16_t%26%20u%29%7B%20%0D%0A%20%20%20%20%20%20%20%20std%3A%3Acout%20%3C%3C%20%22AIN1%20%3D%20%22%20%3C%3C%20to_volts%28BOARD0%2C%200%2C%20u%29%20%3C%3C%22%20V%22%20%3C%3C%20std%3A%3Aendl%3B%20%0D%0A%20%20%20%20%7D%29%3B%20]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=27329&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>