<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="sk">
	<id>https://senzor.robotika.sk/sensorwiki/index.php?action=history&amp;feed=atom&amp;title=Processing_7-segment_display</id>
	<title>Processing 7-segment display - História úprav</title>
	<link rel="self" type="application/atom+xml" href="https://senzor.robotika.sk/sensorwiki/index.php?action=history&amp;feed=atom&amp;title=Processing_7-segment_display"/>
	<link rel="alternate" type="text/html" href="https://senzor.robotika.sk/sensorwiki/index.php?title=Processing_7-segment_display&amp;action=history"/>
	<updated>2026-05-14T17:07:47Z</updated>
	<subtitle>História úprav pre túto stránku na wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://senzor.robotika.sk/sensorwiki/index.php?title=Processing_7-segment_display&amp;diff=7913&amp;oldid=prev</id>
		<title>Balogh na 16:56, 4. marec 2018</title>
		<link rel="alternate" type="text/html" href="https://senzor.robotika.sk/sensorwiki/index.php?title=Processing_7-segment_display&amp;diff=7913&amp;oldid=prev"/>
		<updated>2018-03-04T16:56:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;sk&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Staršia verzia&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Verzia z 16:56, 4. marec 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Riadok 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riadok 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Súbor:OpenSegmentDisplay.jpg|center|500px]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Súbor:OpenSegmentDisplay.jpg|center|500px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Link to the necessary font: https://fontlibrary.org/en/font/segment7 - install before continuing.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arduino code for the simple potentiometer measurement with the local displaying&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arduino code for the simple potentiometer measurement with the local displaying&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Balogh</name></author>
	</entry>
	<entry>
		<id>https://senzor.robotika.sk/sensorwiki/index.php?title=Processing_7-segment_display&amp;diff=7910&amp;oldid=prev</id>
		<title>Balogh: Vytvorená stránka „500px  Arduino code for the simple potentiometer measurement with the local displaying of the value on the OpenSegment display.…“</title>
		<link rel="alternate" type="text/html" href="https://senzor.robotika.sk/sensorwiki/index.php?title=Processing_7-segment_display&amp;diff=7910&amp;oldid=prev"/>
		<updated>2018-03-04T16:50:09Z</updated>

		<summary type="html">&lt;p&gt;Vytvorená stránka „&lt;a href=&quot;/sensorwiki/index.php/S%C3%BAbor:OpenSegmentDisplay.jpg&quot; title=&quot;Súbor:OpenSegmentDisplay.jpg&quot;&gt;center|500px&lt;/a&gt;  Arduino code for the simple potentiometer measurement with the local displaying of the value on the OpenSegment display.…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nová stránka&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Súbor:OpenSegmentDisplay.jpg|center|500px]]&lt;br /&gt;
&lt;br /&gt;
Arduino code for the simple potentiometer measurement with the local displaying&lt;br /&gt;
of the value on the OpenSegment display. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 Serial7Segment is an open source seven segment display. &lt;br /&gt;
&lt;br /&gt;
 Note: This code expects the display to be listening at 9600bps. If your display is not at 9600bps, you can&lt;br /&gt;
 do a software or hardware reset. See the Wiki for more info: &lt;br /&gt;
 http://github.com/sparkfun/Serial7SegmentDisplay/wiki/Special-Commands#wiki-baud&lt;br /&gt;
&lt;br /&gt;
 How to use the display:&lt;br /&gt;
 //https://github.com/sparkfun/Serial7SegmentDisplay/wiki/Basic-Usage#wiki-cursor&lt;br /&gt;
&lt;br /&gt;
 To get this code to work, attached an Serial7Segment to an Arduino Uno using the following pins:&lt;br /&gt;
 Pin 8 on Uno (software serial TX) to RX on Serial7Segment&lt;br /&gt;
 VIN to PWR&lt;br /&gt;
 GND to GND&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;SoftwareSerial.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SoftwareSerial LEDdisplej(2, 3); //RX pin, TX pin&lt;br /&gt;
&lt;br /&gt;
int adcValue = 0;&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
&lt;br /&gt;
      Serial.begin(9600);&lt;br /&gt;
&lt;br /&gt;
  LEDdisplej.begin(9600);  // Talk to the Serial7Segment at 9600 bps&lt;br /&gt;
  LEDdisplej.write(&amp;#039;v&amp;#039;);   // Reset the display - this forces the cursor to return to the beginning of the display&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void loop() &lt;br /&gt;
{&lt;br /&gt;
  adcValue = 0;                           // Filter - average from 16 values &lt;br /&gt;
  for (int i = 1; i&amp;lt;=16; i++)&lt;br /&gt;
    adcValue = adcValue + analogRead(0);&lt;br /&gt;
  adcValue = adcValue/16;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
  char tempString[10];                     // Used for sprintf&lt;br /&gt;
  sprintf(tempString, &amp;quot;%4d&amp;quot;,adcValue);     // Convert into a string that is right adjusted&lt;br /&gt;
  //sprintf(tempString, &amp;quot;%d&amp;quot;, adcValue);   // Convert into a string that is left adjusted (requires digit 1 command)&lt;br /&gt;
  //sprintf(tempString, &amp;quot;%04d&amp;quot;, adcValue); // Convert into a string with leading zeros&lt;br /&gt;
  //sprintf(tempString, &amp;quot;%4X&amp;quot;, adcValue);  // Convert int  HEX, right adjusted&lt;br /&gt;
  &lt;br /&gt;
  LEDdisplej.print(tempString);            // Send serial string out the soft serial port to the S7S&lt;br /&gt;
 &lt;br /&gt;
  Serial.println(tempString);           // Works too, but we don&amp;#039;t need trailing spaces &amp;#039; &amp;#039; in the front&lt;br /&gt;
  // Serial.println(adcValue);&lt;br /&gt;
&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Corresponding Processing code for receiving the value from serial port and displaying&lt;br /&gt;
it in the window same way as the OpenSegment did.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
import processing.serial.*;&lt;br /&gt;
&lt;br /&gt;
 int adcValue = 0;        // value received from Serial &lt;br /&gt;
 // String Unit=&amp;quot;mA&amp;quot;;&lt;br /&gt;
 // String Unit=&amp;quot;kΩ&amp;quot;;&lt;br /&gt;
 // String Unit=&amp;quot;°C&amp;quot;;     // We can use Unicode chars directly&lt;br /&gt;
 String Unit=&amp;quot;\u00B0C&amp;quot;;   // Unicode codes may be entered as well&lt;br /&gt;
 &lt;br /&gt;
 Serial myPort;&lt;br /&gt;
 PFont Segment, Units; &lt;br /&gt;
&lt;br /&gt;
 void setup() {&lt;br /&gt;
                          // Setup the display window &lt;br /&gt;
  size(480, 180);         // Size of the window&lt;br /&gt;
  Segment = createFont(&amp;quot;Segment7&amp;quot;, 150);  // Assign fonts and size &lt;br /&gt;
  Units = createFont(&amp;quot;Arial&amp;quot;, 40);&lt;br /&gt;
  textFont(Segment);&lt;br /&gt;
  textAlign(RIGHT);        // Text align &lt;br /&gt;
  fill(250,250,0);         // Font color is yellow = red + green&lt;br /&gt;
&lt;br /&gt;
  println(Serial.list());    // List all the available serial ports&lt;br /&gt;
  // Then open the port  you&amp;#039;re using, my is the first, i.e. &amp;#039;0&amp;#039;&lt;br /&gt;
   myPort = new Serial(this, Serial.list()[0], 9600);&lt;br /&gt;
 // don&amp;#039;t generate a serialEvent() unless you get a newline character:&lt;br /&gt;
   myPort.bufferUntil(&amp;#039;\n&amp;#039;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
void draw()&lt;br /&gt;
{                      // Let&amp;#039;s start to display&lt;br /&gt;
  background(0,0,0);   // set the background color black&lt;br /&gt;
&lt;br /&gt;
  textFont(Segment);&lt;br /&gt;
  text(adcValue, 400, 150);&lt;br /&gt;
  &lt;br /&gt;
  textFont(Units);&lt;br /&gt;
  text(Unit,465,65);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void serialEvent(Serial myPort) &lt;br /&gt;
{&lt;br /&gt;
 String inString = myPort.readStringUntil(&amp;#039;\n&amp;#039;);    // get the ASCII string:&lt;br /&gt;
 if (inString != null) &lt;br /&gt;
    {&lt;br /&gt;
     inString = trim(inString);     // trim off any whitespace&lt;br /&gt;
     adcValue = int(inString);      // convert into an integer&lt;br /&gt;
     adcValue =int(map(adcValue, 0, 1023, 0, 1023));  // possible range adjusting&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Súbor:OpenSegmentScreenshot.png|center|500px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Balogh</name></author>
	</entry>
</feed>