<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Pokud chci tisknout tabulku, jde blbě použít Serial.print,
protože má variabilní počet znaků podle obsahu. Zkusil jsem proto</p>
<div
style="color: #4e5b61;background-color: #ffffff;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><div><span
style="color: #4e5b61;"> </span><span style="color: #434f54;">(</span><span
style="color: #00979d;">uint16_t</span><span style="color: #434f54;">) napeti</span><span
style="color: #4e5b61;">;</span></div><span style="color: #4e5b61;"></span><span
style="color: #4e5b61;"> </span><span style="color: #d35400;">sprintf_P</span><span
style="color: #434f54;">(</span><span style="color: #4e5b61;">sStringBuffer,</span></div><div> <span
style="color: #d35400;">PSTR</span><span style="color: #434f54;">(</span><span
style="color: #005c5f;">"Napětí%03d.%03dV, "</span><span
style="color: #434f54;">)</span></div><div><div><span
style="color: #4e5b61;"> napeti</span><span
style="color: #4e5b61;">/</span><span style="color: #005c5f;">1000</span><span
style="color: #4e5b61;">,napeti</span><span style="color: #4e5b61;">%</span><span
style="color: #005c5f;">1000</span><span style="color: #434f54;">)</span><span
style="color: #4e5b61;">;</span></div><span style="color: #4e5b61;"></span></div><span
style="color: #4e5b61;"> </span><span style="color: #d35400;">Serial</span><span
style="color: #4e5b61;">.</span><span style="color: #d35400;">print</span><span
style="color: #434f54;">(</span><span style="color: #4e5b61;">sStringBuffer</span><span
style="color: #434f54;">)</span><span style="color: #4e5b61;">;</span></div>
<div
style="color: #4e5b61;background-color: #ffffff;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><span
style="color: #4e5b61;">
</span></div>
<div
style="color: #4e5b61;background-color: #ffffff;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><span
style="color: #4e5b61;">Jenže float neumí a tak jak jsem to napsal to vypisuje nesmysl pro hodnotu -123, kterou chci zobrazit jako -0.125V (ztratí se -)</span></div>
<div
style="color: #4e5b61;background-color: #ffffff;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><span
style="color: #4e5b61;">
</span></div>
<span style="color: #4e5b61;">Jak to správně napsat?</span>
<p></p>
<pre class="moz-signature" cols="72">--
Martin Záruba</pre>
</body>
</html>