<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Showing numbers with the flashes of light]]></title><description><![CDATA[<h1>Showing numbers with the flashes of light</h1>
<p dir="auto">Hello! If a situation arises when it is necessary to find out the humidity and temperature, but the display is not possible to use for some reason.</p>
<p dir="auto"><img src="https://sun9-63.userapi.com/c857228/v857228374/584c7/dtQYCf3fOI8.jpg" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">List of reasons:</p>
<ul>
<li>expensive;</li>
<li>afraid of moisture;</li>
<li>too lazy to solder;</li>
<li>a small print that is not visible at all;</li>
<li>important aesthetics and minimalism;</li>
<li>all listed together.</li>
</ul>
<p dir="auto">In this case, there is an excellent reason to use the color approach to displaying information. Everything would be fine, but the primary colors are completely worthless - some seven (from the rainbow). Can you distinguish between light blue and blue or yellow from orange? What to do? Remove such strange colors! Leave: Red, Yellow, Green, Blue, Purple and White (unexpectedly, yes?). How much did it work? 6. And there are 10 digits, and even a minus for negative numbers, a floating point and a separator. We will be smart and make a flasher! Violet - it will be 5, and six it will be 5 + 1, and 1 will be Red. Just fit. Huh! Table 1 shows the colors for the corresponding characters.</p>
<p dir="auto">Table 1</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:center">Number (or char)</th>
<th style="text-align:center">Color (s)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Zero</td>
<td style="text-align:center">blink VIOLET</td>
</tr>
<tr>
<td style="text-align:center">One</td>
<td style="text-align:center">light up RED</td>
</tr>
<tr>
<td style="text-align:center">Two</td>
<td style="text-align:center">light up YELLOW</td>
</tr>
<tr>
<td style="text-align:center">Three</td>
<td style="text-align:center">light up GREEN</td>
</tr>
<tr>
<td style="text-align:center">Four</td>
<td style="text-align:center">light up BLUE</td>
</tr>
<tr>
<td style="text-align:center">Five</td>
<td style="text-align:center">light up VIOLET</td>
</tr>
<tr>
<td style="text-align:center">Six</td>
<td style="text-align:center">blink VIOLET / RED</td>
</tr>
<tr>
<td style="text-align:center">Seven</td>
<td style="text-align:center">blink VIOLET / YELLOW</td>
</tr>
<tr>
<td style="text-align:center">Eight</td>
<td style="text-align:center">blink VIOLET / GREEN</td>
</tr>
<tr>
<td style="text-align:center">Nine</td>
<td style="text-align:center">blink VIOLET / BLUE</td>
</tr>
<tr>
<td style="text-align:center">Negative (-)</td>
<td style="text-align:center">blink WHITE / RED</td>
</tr>
<tr>
<td style="text-align:center">Floating point (.)</td>
<td style="text-align:center">blink WHITE</td>
</tr>
<tr>
<td style="text-align:center">Line feed (\n)</td>
<td style="text-align:center">light up WHITE</td>
</tr>
</tbody>
</table>
<p dir="auto">Primary you need download and connect the library. Then declare a custom callback function <strong>void callback (int, int, int)</strong> R, G, B - channels (from 0 to 255), which will access the hardware (light up the LED). Call the <strong>lightf</strong> function, where the first argument will be a pointer to this same callback function, then a line with a format that is completely analogous to <strong>printf</strong> and any number of arguments. Remember to use the newline character <strong>\ n</strong>, after each qualifier in the format string.</p>
<p dir="auto">At my fingertips lies the Base Unit <strong>M5Stack FIRE</strong> with built-in <strong>Neopixel</strong> panels, for testing, as nothing else is better. You can watch a video demonstrating a sketch showing the Pi number with an accuracy of 6 decimal places (YouTube)  <a href="https://youtu.be/NuSW0IrXjeo" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">Thanks!</p>
<p dir="auto">Download library (GitHub) <a href="https://github.com/dsiberia9s/Lightf" target="_blank" rel="noopener noreferrer nofollow ugc">here</a></p>
]]></description><link>https://community.m5stack.com/topic/1495/showing-numbers-with-the-flashes-of-light</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 12:36:35 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1495.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Nov 2019 08:37:00 GMT</pubDate><ttl>60</ttl></channel></rss>