Yvan<p>FUCKING A!</p><p>I have a <a href="https://toot.ale.gd/tags/Rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Rust</span></a> programme on my <a href="https://toot.ale.gd/tags/RaspberryPi" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RaspberryPi</span></a> <a href="https://toot.ale.gd/tags/PicoW" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PicoW</span></a> that reads data (an u16) from a sensor and you can then get that data from a web request. HUGE ACHIEVEMENT.</p><p>It has taken me like… a large chunk of three days… To get to this point from having code that reads the sensor and serves web requests. 😂 I feel like a moron. But hey, I've only been coding Rust for ~5 days. Probably taking the hard path by going straight into embedded with no::std…</p><p>It has taken so many attempts to get to grips with scopes, mutables, Rust's bloody intense syntax, etc, etc… but in the end I've worked out a way to pass a u16 to both spawned workers via some sort of a Mutex. I think I might have an extra level of indirection I don't need… but fuck it, I'll take that I can do this at all as a win. </p><p>Now I can take it outside (i.e. not USB-tethered) and see what it reads as an outdoor CO2 PPM measurement.</p><p>(I could have had this working in C++ in… minutes, but no, I'm a masochist.)</p><p><a href="https://toot.ale.gd/tags/embedded" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>embedded</span></a> <a href="https://toot.ale.gd/tags/embassy" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>embassy</span></a></p>