<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://so.v2.cs.unibo.it/wiki/index.php?action=history&amp;feed=atom&amp;title=Arduino_web_controller</id>
	<title>Arduino web controller - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://so.v2.cs.unibo.it/wiki/index.php?action=history&amp;feed=atom&amp;title=Arduino_web_controller"/>
	<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;action=history"/>
	<updated>2026-04-16T20:18:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=932&amp;oldid=prev</id>
		<title>GFede at 15:28, 24 March 2015</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=932&amp;oldid=prev"/>
		<updated>2015-03-24T15:28:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:28, 24 March 2015&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-l194&quot; &gt;Line 194:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 194:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;if(isset($_GET[&amp;quot;script&amp;quot;]) &amp;amp;&amp;amp; isset($_GET[&amp;quot;args&amp;quot;]))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;if(isset($_GET[&amp;quot;script&amp;quot;]) &amp;amp;&amp;amp; isset($_GET[&amp;quot;args&amp;quot;]))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;{&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    $result = exec($_GET[&amp;quot;script&amp;quot;].&amp;quot; &amp;quot;.$_GET[&amp;quot;args&amp;quot;].&amp;quot; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2&amp;gt;&amp;amp;1&lt;/del&gt;&amp;quot;, $output, $return);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;    $result = exec($_GET[&amp;quot;script&amp;quot;].&amp;quot; &amp;quot;.$_GET[&amp;quot;args&amp;quot;].&amp;quot;&amp;quot;, $output, $return);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;       echo $_GET[&amp;quot;script&amp;quot;].&amp;quot; &amp;quot;.$_GET[&amp;quot;args&amp;quot;].&amp;quot; called, result = $result!&amp;lt;br/&amp;gt;&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;       echo $_GET[&amp;quot;script&amp;quot;].&amp;quot; &amp;quot;.$_GET[&amp;quot;args&amp;quot;].&amp;quot; called, result = $result!&amp;lt;br/&amp;gt;&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>GFede</name></author>
	</entry>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=930&amp;oldid=prev</id>
		<title>GFede at 14:10, 24 March 2015</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=930&amp;oldid=prev"/>
		<updated>2015-03-24T14:10:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:10, 24 March 2015&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-l3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;se n e' minore di 10 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mand &lt;/del&gt;a LOW al numero specificato, se e' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;maggiore &lt;/del&gt;di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;se n e' minore di 10 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;manda &lt;/ins&gt;a LOW al numero specificato, se e' di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;Sketch Arduino:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;Sketch Arduino:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>GFede</name></author>
	</entry>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=929&amp;oldid=prev</id>
		<title>GFede at 14:09, 24 March 2015</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=929&amp;oldid=prev"/>
		<updated>2015-03-24T14:09:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:09, 24 March 2015&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-l3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;se n e' minore di 10 mand a LOW al numero &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;secificato&lt;/del&gt;, se e' maggiore di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;se n e' minore di 10 mand a LOW al numero &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;specificato&lt;/ins&gt;, se e' maggiore di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;Sketch Arduino:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;Sketch Arduino:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>GFede</name></author>
	</entry>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=928&amp;oldid=prev</id>
		<title>GFede at 14:07, 24 March 2015</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=928&amp;oldid=prev"/>
		<updated>2015-03-24T14:07:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:07, 24 March 2015&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;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&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;&gt; &lt;/td&gt;&lt;td class='diff-marker'&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;== Federico Giuggioloni ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&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 class='diff-marker'&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;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;se n e' minore di 10 mand a LOW al numero secificato, se e' maggiore di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;se n e' minore di 10 mand a LOW al numero secificato, se e' maggiore di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>GFede</name></author>
	</entry>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=927&amp;oldid=prev</id>
		<title>GFede: Created page with &quot;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai prim...&quot;</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=Arduino_web_controller&amp;diff=927&amp;oldid=prev"/>
		<updated>2015-03-24T14:03:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Programma in C che, se richiamato da PHP, permette di controllare l&amp;#039;arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai prim...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Programma in C che, se richiamato da PHP, permette di controllare l'arduino da remoto, in questo esempio ho solo aggiunto la funzione per mandare il segnale HIGH o LOW ai primi 9 pin attraverso il comando SEND n.&lt;br /&gt;
se n e' minore di 10 mand a LOW al numero secificato, se e' maggiore di 10 e minore di 20 manda HIGH al pin specificato dalla seconda cifra.&lt;br /&gt;
&lt;br /&gt;
Sketch Arduino:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int incomingByte = -1;&lt;br /&gt;
&lt;br /&gt;
void setup()  &lt;br /&gt;
{&lt;br /&gt;
  // Open serial communications and wait for port to open:&lt;br /&gt;
  Serial.begin(9600);  //57600&lt;br /&gt;
  &lt;br /&gt;
  pinMode(8, OUTPUT);&lt;br /&gt;
  &lt;br /&gt;
  Serial.println(&amp;quot;Hello world!&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop() // run over and over&lt;br /&gt;
{&lt;br /&gt;
  if (Serial.available() &amp;gt; 0)&lt;br /&gt;
  {&lt;br /&gt;
    incomingByte = Serial.read();&lt;br /&gt;
    Serial.print(&amp;quot;I received: &amp;quot;);&lt;br /&gt;
    Serial.println(incomingByte, DEC);&lt;br /&gt;
    &lt;br /&gt;
    if( incomingByte &amp;lt; 10 )&lt;br /&gt;
    {&lt;br /&gt;
       digitalWrite(incomingByte, LOW); &lt;br /&gt;
    }&lt;br /&gt;
    else if(incomingByte &amp;lt; 20)&lt;br /&gt;
    {&lt;br /&gt;
       digitalWrite(incomingByte-10, HIGH);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Programma in C che interpreta i comandi e invia un numero all'arduino corrispondente alla azione da intraprendere:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MAXIMUM_CHAIN 16&lt;br /&gt;
&lt;br /&gt;
void usage()&lt;br /&gt;
{&lt;br /&gt;
   printf(&amp;quot;Usage:\n\tarduino-controller /dev/ttyUSBX\nWhere X depends on which port arduino is connected to\n&amp;quot;);&lt;br /&gt;
   exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void checkError(int result)&lt;br /&gt;
{&lt;br /&gt;
   if(result &amp;lt; 0)&lt;br /&gt;
   {&lt;br /&gt;
      printf(&amp;quot;Error: %s (%i)\n&amp;quot;, strerror(errno), errno);&lt;br /&gt;
      exit(1);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * strspl&lt;br /&gt;
 * @author Federico Giuggioloni&lt;br /&gt;
 * Splits a string and allocates memory for an array&lt;br /&gt;
 * which contains the result of the split.&lt;br /&gt;
 *&lt;br /&gt;
 * @param char*** split a pointer to a string array,&lt;br /&gt;
 *          can be null. after the call, it'll be an&lt;br /&gt;
 *          array with the required elements.&lt;br /&gt;
 * @param char* string a pointer to the string to split&lt;br /&gt;
 * @param const char* delim a pointer to the delimiter.&lt;br /&gt;
 * @return number of elements in the split array&lt;br /&gt;
 */&lt;br /&gt;
int strspl(char*** split, char* string, const char* delim)&lt;br /&gt;
{&lt;br /&gt;
   char* result;&lt;br /&gt;
   char* parsed = malloc(strlen(string)+1);&lt;br /&gt;
   char* tofree = parsed;&lt;br /&gt;
&lt;br /&gt;
   if(*split == NULL)&lt;br /&gt;
   {&lt;br /&gt;
      *split = malloc(sizeof(char*) * MAXIMUM_CHAIN);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   strcpy(parsed, string);&lt;br /&gt;
&lt;br /&gt;
   int i = 0;&lt;br /&gt;
   while((result = strtok(parsed, delim)) != NULL)&lt;br /&gt;
   {&lt;br /&gt;
      //subsequent calls to strtok must have NULL in the first&lt;br /&gt;
      //parameter&lt;br /&gt;
      parsed = NULL;&lt;br /&gt;
&lt;br /&gt;
      //(*split)[i] = result;&lt;br /&gt;
      (*split)[i] = malloc(strlen(result) * sizeof(char) + 1);&lt;br /&gt;
      strcpy((*split)[i], result);&lt;br /&gt;
&lt;br /&gt;
      printf(&amp;quot;%s\n&amp;quot;, result);&lt;br /&gt;
&lt;br /&gt;
      i++;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   free(tofree);&lt;br /&gt;
   return i;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * read_commands&lt;br /&gt;
 * @author Federico Giuggioloni&lt;br /&gt;
 * Reads commands from an array produced by strspl&lt;br /&gt;
 *&lt;br /&gt;
 * @return integer determining which action has to be executed&lt;br /&gt;
 *          (HINTHINT Send it directly to arduino)&lt;br /&gt;
 */&lt;br /&gt;
char read_commands(char** commands, int argc)&lt;br /&gt;
{&lt;br /&gt;
   int action = 0;&lt;br /&gt;
   int pin;&lt;br /&gt;
&lt;br /&gt;
   if(strcmp(commands[0], &amp;quot;LED&amp;quot;) == 0)&lt;br /&gt;
   {&lt;br /&gt;
      if(strcmp(commands[1], &amp;quot;ON&amp;quot;) == 0)&lt;br /&gt;
      {&lt;br /&gt;
         pin = atoi(commands[2]);&lt;br /&gt;
         action = 10 + pin;&lt;br /&gt;
      }&lt;br /&gt;
      else if(strcmp(commands[2], &amp;quot;OFF&amp;quot;) == 0)&lt;br /&gt;
      {&lt;br /&gt;
         pin = atoi(commands[2]);&lt;br /&gt;
         action = 0 + pin;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   else if(strcmp(commands[0], &amp;quot;SEND&amp;quot;) == 0)&lt;br /&gt;
   {&lt;br /&gt;
      action = atoi(commands[1]);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return action;//TODO&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
   if(argc &amp;lt; 1) usage();&lt;br /&gt;
&lt;br /&gt;
   int fd;&lt;br /&gt;
   int i;&lt;br /&gt;
   char* message;&lt;br /&gt;
   size_t size = 1024;&lt;br /&gt;
   int read;&lt;br /&gt;
   char** split = NULL;&lt;br /&gt;
   int tokens;&lt;br /&gt;
   char delim = ' ';&lt;br /&gt;
   char read_command = 0;&lt;br /&gt;
&lt;br /&gt;
   message = malloc(size);&lt;br /&gt;
&lt;br /&gt;
   fd = open(argv[1], O_RDWR);&lt;br /&gt;
   checkError(fd);&lt;br /&gt;
&lt;br /&gt;
   if(argc &amp;gt; 2)&lt;br /&gt;
   {&lt;br /&gt;
      read_command = read_commands(argv+2, argc-2);&lt;br /&gt;
      write(fd, &amp;amp;read_command, 1);&lt;br /&gt;
      exit(0);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   do&lt;br /&gt;
   {&lt;br /&gt;
      read = getline(&amp;amp;message, &amp;amp;size, stdin);&lt;br /&gt;
&lt;br /&gt;
      tokens = strspl(&amp;amp;split, message, &amp;amp;delim);&lt;br /&gt;
&lt;br /&gt;
      read_command = read_commands(split, tokens);&lt;br /&gt;
      write(fd, &amp;amp;read_command, 1);&lt;br /&gt;
&lt;br /&gt;
   }while(1);&lt;br /&gt;
&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Script PHP che usa la exec per eseguire il programma C. Richiede pero' i permessi al file di arduino in /dev e al programma C, altrimenti restituisce permission denied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
if(isset($_GET[&amp;quot;script&amp;quot;]) &amp;amp;&amp;amp; isset($_GET[&amp;quot;args&amp;quot;]))&lt;br /&gt;
{&lt;br /&gt;
   $result = exec($_GET[&amp;quot;script&amp;quot;].&amp;quot; &amp;quot;.$_GET[&amp;quot;args&amp;quot;].&amp;quot; 2&amp;gt;&amp;amp;1&amp;quot;, $output, $return);&lt;br /&gt;
      echo $_GET[&amp;quot;script&amp;quot;].&amp;quot; &amp;quot;.$_GET[&amp;quot;args&amp;quot;].&amp;quot; called, result = $result!&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
      if(!$return)&lt;br /&gt;
      {&lt;br /&gt;
         echo &amp;quot;Succesful!&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
         echo &amp;quot;No.&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      echo &amp;quot;$output&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
      echo &amp;quot;$result&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>GFede</name></author>
	</entry>
</feed>