<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How To Control a Ultrasonic Sensor with Raspberry PI: Get Object Distance with Python	</title>
	<atom:link href="https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/feed/" rel="self" type="application/rss+xml" />
	<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/</link>
	<description>Raspberry PI, Arduino and Electronics made simple</description>
	<lastBuildDate>Thu, 19 Jun 2025 16:35:15 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: peppe8o		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13288</link>

		<dc:creator><![CDATA[peppe8o]]></dc:creator>
		<pubDate>Sat, 02 Apr 2022 10:13:40 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13288</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13191&quot;&gt;nix666&lt;/a&gt;.

Argh... You are right!
Thank you for your note, corrected]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13191">nix666</a>.</p>
<p>Argh&#8230; You are right!<br />
Thank you for your note, corrected</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nix666		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13191</link>

		<dc:creator><![CDATA[nix666]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 13:57:18 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13191</guid>

					<description><![CDATA[Hi again, just a little mistake I noticed. At the top where it says &quot;otherwise, you can get it installed with the command “sudo apt-install python3-rpi.gpio”, that needs to be sudo apt-get install or sudo apt install, for those that are new to linux :)]]></description>
			<content:encoded><![CDATA[<p>Hi again, just a little mistake I noticed. At the top where it says &#8220;otherwise, you can get it installed with the command “sudo apt-install python3-rpi.gpio”, that needs to be sudo apt-get install or sudo apt install, for those that are new to linux 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nix666		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13175</link>

		<dc:creator><![CDATA[nix666]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 11:41:39 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13175</guid>

					<description><![CDATA[Got it working ! Thank you again!
Regards]]></description>
			<content:encoded><![CDATA[<p>Got it working ! Thank you again!<br />
Regards</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: peppe8o		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13162</link>

		<dc:creator><![CDATA[peppe8o]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 10:19:51 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13162</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13161&quot;&gt;nix666&lt;/a&gt;.

Ok, please remove this part from the print statement:
+ &quot; &quot;, end=&#039;\r&#039;

At the end, it should work as required]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13161">nix666</a>.</p>
<p>Ok, please remove this part from the print statement:<br />
+ &#8221; &#8220;, end=&#8217;\r&#8217;</p>
<p>At the end, it should work as required</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nix666		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13161</link>

		<dc:creator><![CDATA[nix666]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 10:14:20 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13161</guid>

					<description><![CDATA[Thank you - here is the new code :https://pastebin.com/paZ6bX8J
It prints the distance reading for a couple of seconds ( 4-5 ) seconds, then stops. So it&#039;s not infinite anymore.
Now I need to figure out how to get 10 readings, each one on a new line, so that I can print that to a text file.The 10 readings fluctuate, but to fast to capture all ten different ones. 
Any input would be most welcome.]]></description>
			<content:encoded><![CDATA[<p>Thank you &#8211; here is the new code :<a href="https://pastebin.com/paZ6bX8J" rel="nofollow ugc">https://pastebin.com/paZ6bX8J</a><br />
It prints the distance reading for a couple of seconds ( 4-5 ) seconds, then stops. So it&#8217;s not infinite anymore.<br />
Now I need to figure out how to get 10 readings, each one on a new line, so that I can print that to a text file.The 10 readings fluctuate, but to fast to capture all ten different ones.<br />
Any input would be most welcome.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: peppe8o		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13159</link>

		<dc:creator><![CDATA[peppe8o]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 10:05:43 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13159</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13157&quot;&gt;nix666&lt;/a&gt;.

Ah, ok.
The print statement must stay in a different row from while one. It has also to be indented compared to the while line.
The x+=1 line has to be indented as the print statement]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13157">nix666</a>.</p>
<p>Ah, ok.<br />
The print statement must stay in a different row from while one. It has also to be indented compared to the while line.<br />
The x+=1 line has to be indented as the print statement</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nix666		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13157</link>

		<dc:creator><![CDATA[nix666]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 09:56:40 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13157</guid>

					<description><![CDATA[I let it run for more than 5 minutes : 
The ouput is :
Distance: 287.5 - and this fluctuates, but hasn&#039;t stopped.]]></description>
			<content:encoded><![CDATA[<p>I let it run for more than 5 minutes :<br />
The ouput is :<br />
Distance: 287.5 &#8211; and this fluctuates, but hasn&#8217;t stopped.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: peppe8o		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13155</link>

		<dc:creator><![CDATA[peppe8o]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 09:51:26 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13155</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13154&quot;&gt;nix666&lt;/a&gt;.

The pastebin is about the new code.
I didn&#039;t understand if it stopped or not after the 10 runnings. Please can you share the print output?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13154">nix666</a>.</p>
<p>The pastebin is about the new code.<br />
I didn&#8217;t understand if it stopped or not after the 10 runnings. Please can you share the print output?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nix666		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13154</link>

		<dc:creator><![CDATA[nix666]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 09:45:50 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13154</guid>

					<description><![CDATA[It works, gives me the distance , beet it keeps on running infinitely, printing the reading in the same line.
Here is what I have :https://pastebin.com/FvTTCXcX]]></description>
			<content:encoded><![CDATA[<p>It works, gives me the distance , beet it keeps on running infinitely, printing the reading in the same line.<br />
Here is what I have :<a href="https://pastebin.com/FvTTCXcX" rel="nofollow ugc">https://pastebin.com/FvTTCXcX</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: peppe8o		</title>
		<link>https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13150</link>

		<dc:creator><![CDATA[peppe8o]]></dc:creator>
		<pubDate>Fri, 01 Apr 2022 09:32:58 +0000</pubDate>
		<guid isPermaLink="false">https://peppe8o.com/?p=1755#comment-13150</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13139&quot;&gt;nix666&lt;/a&gt;.

...and remove the &quot;while True:&quot; line from your code]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://peppe8o.com/hcsr04-ultrasonic-sensor-raspberry-pi/#comment-13139">nix666</a>.</p>
<p>&#8230;and remove the &#8220;while True:&#8221; line from your code</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
