<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="301422" data-post-id="301422">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mmmries" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mmmries/120/2685_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mmmries
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s working! I have it sampling 10x per second and then I take zones 6,7, 10 and 11 (in the middle) and wire them up to the front 2 RGB LEDs so that they get dim when it senses something close. This will give me a visual indication of what the bot thinks that it sees ahead.</p>
<div class="youtube-onebox lazy-video-container" data-video-id="FYlPeyLQ1Zk" data-video-title="Trilobot measuring distance" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=FYlPeyLQ1Zk" target="_blank" class="video-thumbnail" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://img.youtube.com/vi/FYlPeyLQ1Zk/maxresdefault.jpg" title="Trilobot measuring distance" width="690" height="388">
  </a>
</div>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301422" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/using-tmf8821-time-of-flight-sensor-for-navigation/58081/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-301422" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301422"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="301996" data-post-id="301996">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mmmries" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mmmries/120/2685_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mmmries
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Now that I have my sensor talking to nerves, there are two follow-up items I need to address:</p>
<ol>
<li>Update the <code>tmf882x</code> project <a href="https://github.com/pkinney/tmf882x/issues/1" rel="noopener nofollow ugc">to use circuit_gpio v2+</a></li>
<li>Mount the sensor in a reliable way to the trilobot</li>
</ol>
<p>The first project can be all done in software and involves learning fun new things like how to do host-based testing of an I2C interface, but I’ve been programming all week for work. So I’m going to do the obviously wrong thing and start with project 2</p>
<p>The first thing I noticed is that the Trilobot “leans back a little”, so I put it on a flat surface and measured that the front of the trilobot is about 1cm higher than the back. And since I can’t be bothered to look up the trig I learned back in high school, I just drew a quick sketch in onshape and asked it to measure the angle for me.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/a/1/a1cdb375d8996a09ba3864afd03091e9e6e76445.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/a1cdb375d8996a09ba3864afd03091e9e6e76445" title="Screenshot 2023-09-23 at 15.10.43" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/a/1/a1cdb375d8996a09ba3864afd03091e9e6e76445_2_690x256.jpeg" alt="Screenshot 2023-09-23 at 15.10.43" data-base62-sha1="n5nAhgTK9C8ATVpVjXbZ7E7edwh" width="690" height="256" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/a/1/a1cdb375d8996a09ba3864afd03091e9e6e76445_2_690x256.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/a/1/a1cdb375d8996a09ba3864afd03091e9e6e76445_2_1035x384.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/a/1/a1cdb375d8996a09ba3864afd03091e9e6e76445_2_1380x512.jpeg 2x" data-dominant-color="F6F6F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2023-09-23 at 15.10.43</span><span class="informations">2344×870 54.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Then I grabbed <a href="https://cad.onshape.com/documents/ea86bea5f71524a1b51d070e/v/b315dff3877ad1972771d7e3/e/8044c5e68bf704b7de73e8ad?renderMode=0&amp;uiState=650ef23907082e49a3d329e3" rel="noopener nofollow ugc">the cad model</a> I had previously made of the Trilobot and copied out the “front board” part, removed the holes for the ultrasonic sensor, and added a tilted face with this same angle.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/9/2/9200a6c315676dfff45b71bc5a19eef071ea3ac3.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/9200a6c315676dfff45b71bc5a19eef071ea3ac3" title="Screenshot 2023-09-23 at 15.13.31" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/9/2/9200a6c315676dfff45b71bc5a19eef071ea3ac3_2_450x600.jpeg" alt="Screenshot 2023-09-23 at 15.13.31" data-base62-sha1="kPB6AKoSRhWD04DKp6ZhbmxOdiP" width="450" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/9/2/9200a6c315676dfff45b71bc5a19eef071ea3ac3_2_450x600.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/9/2/9200a6c315676dfff45b71bc5a19eef071ea3ac3_2_675x900.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/9/2/9200a6c315676dfff45b71bc5a19eef071ea3ac3_2_900x1200.jpeg 2x" data-dominant-color="F0F2F5"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2023-09-23 at 15.13.31</span><span class="informations">958×1276 23.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Then I sketched in the mounting holes based on the TMF8821 datasheet that shows the location of the 3 mounting holes, and cut out those holes from the model.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/2/2/228c44355f5363753bc6571fa4490745c66516b2.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/228c44355f5363753bc6571fa4490745c66516b2" title="Screenshot 2023-09-23 at 15.14.57" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/2/2/228c44355f5363753bc6571fa4490745c66516b2_2_525x600.jpeg" alt="Screenshot 2023-09-23 at 15.14.57" data-base62-sha1="4VCKIhAwY3a5mlBinbyOYMyFWNk" width="525" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/2/2/228c44355f5363753bc6571fa4490745c66516b2_2_525x600.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/2/2/228c44355f5363753bc6571fa4490745c66516b2_2_787x900.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/2/2/228c44355f5363753bc6571fa4490745c66516b2_2_1050x1200.jpeg 2x" data-dominant-color="C3D5E1"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2023-09-23 at 15.14.57</span><span class="informations">1100×1256 29.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Exported this to 3mf, sliced it and sent it to my 3d printer. We’ll see in 30min if it fits <img src="https://forum.elixirforum.com/images/emoji/apple/crossed_fingers.png?v=15" title=":crossed_fingers:" class="emoji" alt=":crossed_fingers:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="301996" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/using-tmf8821-time-of-flight-sensor-for-navigation/58081/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-301996" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="301996"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>