<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Tech Portfolio</title>
	<atom:link href="http://www.saki-kawa.com/techportfolio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.saki-kawa.com/techportfolio</link>
	<description>Saki&#039;s tech portfolio</description>
	<lastBuildDate>Sat, 04 Feb 2012 14:10:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Spoka Box &#8211; S.M.S. ver 2.0 &#8211; Eng</title>
		<link>http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/</link>
		<comments>http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 16:21:00 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[Spoka Box - S.M.S. ver 2.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=77</guid>
		<description><![CDATA[This is the Spoka Box ver 2.0. It’s an upgraded version of this one. First of all, “why Spoka Box?” In the very first version its name was S.M.S., that stands for Scatola Magica della Solitudine [eng: Magic Box of Loneliness], and it was a gift for my girlfriend, who studies and lives far away &#8230;]]></description>
			<content:encoded><![CDATA[<p>This is the Spoka Box ver 2.0.<br />
It’s an upgraded version of <a title="S.M.S. ver 1.0 – Eng – How To" href="http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-eng-how-to/" target="_blank">this one</a>.</p>
<p>First of all, “why Spoka Box?”<br />
In the very first version its name was S.M.S., that stands for Scatola Magica della Solitudine [eng: Magic Box of Loneliness], and it was a gift for my girlfriend, who studies and lives far away from our city 5 day a week.<br />
The goal was to give her a present to remember me and don’t feel loneliness. It could show some random sentences to encourage her and a simple romantic “cartoon”.<br />
Now, the main features and the design is totally upgraded and the gift needed a new name, Spoka Box, from the name of the little night light bought from IKEA.<br />
Spoka Box essentially is an alarm clock with a graceful and funny design, but in the inner core it’s an useful butler.<br />
In fact Spoka Box is programmed to wake up its master gently, turning on a soft light some minutes before the alarm time, and it’s upgradable with much more usable functionalities (some will be added in the near future).</p>
<p style="text-align: center;"><strong>Features and description</strong></p>
<p><strong>Features</strong></p>
<ul>
<li>clock and date</li>
<li>alarm clock</li>
<li>midi alarm song</li>
<li>before alarm, wake up mood light</li>
<li>independent mood light</li>
<li>random sentences (in main screen and by a button function)</li>
<li>simple cartoon</li>
</ul>
<p><em>Clock functions.</em><br />
Date and time are configurable by a dedicate menu and saved into an internal chip, that has its own battery.<br />
The time is shown in a very big style in the middle of the screen, the date and the week day is visible in the top right corner.<br />
In the top left corner you can see an “*”, that indicates the alarm is set on.</p>
<p><em>Midi alarm song.</em><br />
In the main persistent memory there is a midi song saved for the alarm functions.<br />
The Spoka Box uses two 2W speakers with standard 3.5mm jack, that have a volume control in the back.</p>
<p><em>Spoka Box functions.</em><br />
The spoka light can works totally independent by the Spoka Box, can also be detached from it and used with its internal rechargeable battery, and have three states: off, “slow changing color light” and fixed light.<br />
When 10 minutes till wake up, in any states the spoka light is, the Spoka Box set the “slow changing color light” state.<br />
When alarm (and song) starts, the Spoka Box create a new state for the spoka light, by a loop between on and off, it blinks the light.<br />
Now you can switch off the alarm and the spoka light remain in “slow changing color light” until 15 minutes pass, or you can turn it off pushing its head.</p>
<p><em>Random sentences.</em><br />
It shows a random sentence from a list.<br />
Every minute one of this sentence is shown in the bottom of the main screen, or you can see one by selecting the function in the menu.</p>
<p><em>Cartoon.</em><br />
It shows a short lovely animation.<br />
It uses a matrix of the positions of every single elements of the cartoon.</p>
<p><strong>Design.</strong><br />
The design of the Spoka Box is made of four main parts: core box, box support, spoka light and speakers.</p>
<p><em>Core box.</em><br />
The core box is where the main board, memory and clock chip (and battery) are.<br />
It’s made from an electric derivation box (plastic), covered by purple cloth and some yellow flowers.<br />
It has a 3.5mm jack for spoka light control, a 3.5mm jack for audio out, and a mini usb port to firmware update and power supplier.<br />
On the right side there is a pot to control the screen brightness.</p>
<p><em>Box support.</em><br />
The Box support is made from an IKEA cutlery holder (name: Magasin, price: € 2 ca.), painted and modified to look like the “E” letter.. my girlfriend name is Elisa. <img src='http://www.saki-kawa.com/techportfolio/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
It also has two little magnets inside the top, to firmly attach the core box.</p>
<p><em>Spoka light.</em><br />
It’s a night light from IKEA (name: Spoka, price: € 13 ca.).<br />
It has been added a little board (a power mosfet used as a switch), put into the core box, and a 3.5mm jack inside, to read the light state and to change it by an electric impulse, simulating the head button press.</p>
<p><em>Speakers.</em><br />
Normal 2W, 3.5mm jack, speakers, with volume control in the back and a nice looking design.</p>
<p style="text-align: left;"><strong>How it’s done (hardware).<br />
</strong><em><strong>Components:</strong><br />
</em><em>core box:</em></p>
<ul>
<li><a href="http://www.arduino.cc/" target="_blank">Arduino</a>,</li>
<li><a href="http://www.sparkfun.com/products/710" target="_blank">graphic LCD</a>,</li>
<li>LCD shield (by me),</li>
<li>2 buttons,</li>
<li>2 trimmers,</li>
<li>2 3.5mm jacks,</li>
<li>mini breadboard,</li>
<li>1 electric box.</li>
</ul>
<p><em>Spoka light:</em></p>
<ul>
<li>Spoka night light,</li>
<li>1 mini board with a power mosfet (into spoka light),</li>
<li>1 3.5mm jack.</li>
</ul>
<p>You can find the code and some information about LCD <a href="http://www.arduino.cc/playground/Code/GLCDks0108" target="_blank">here</a>.<br />
Some functions and menus code snippet will come (the code needs some public readable updates).</p>
<p style="text-align: center;"><strong>Photos</strong></p>

<a href='http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/imag0141/' title='IMAG0141'><img width="150" height="150" src="http://www.saki-kawa.com/techportfolio/files/2011/07/IMAG0141-150x150.jpg" class="attachment-thumbnail" alt="IMAG0141" title="IMAG0141" /></a>
<a href='http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/imag0143/' title='IMAG0143'><img width="150" height="150" src="http://www.saki-kawa.com/techportfolio/files/2011/07/IMAG0143-150x150.jpg" class="attachment-thumbnail" alt="IMAG0143" title="IMAG0143" /></a>
<a href='http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/imag0144/' title='IMAG0144'><img width="150" height="150" src="http://www.saki-kawa.com/techportfolio/files/2011/07/IMAG0144-150x150.jpg" class="attachment-thumbnail" alt="IMAG0144" title="IMAG0144" /></a>
<a href='http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/imag0146/' title='IMAG0146'><img width="150" height="150" src="http://www.saki-kawa.com/techportfolio/files/2011/07/IMAG0146-150x150.jpg" class="attachment-thumbnail" alt="IMAG0146" title="IMAG0146" /></a>

<p style="text-align: center;"><strong>Video</strong></p>
<p style="text-align: left;"><iframe src="http://www.youtube.com/embed/wwnBI1Z_gAw" frameborder="0" width="480" height="360"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spoka Box &#8211; S.M.S. ver 2.0 &#8211; Ita</title>
		<link>http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-ita/</link>
		<comments>http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-ita/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 16:16:44 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[Spoka Box - S.M.S. ver 2.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=70</guid>
		<description><![CDATA[Cooming soon! &#160; Nel frattempo leggi la versione in inglese qui!]]></description>
			<content:encoded><![CDATA[<p>Cooming soon!</p>
<p>&nbsp;</p>
<p>Nel frattempo leggi la versione in inglese <a title="Spoka Box – S.M.S. ver 2.0 – Eng" href="http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/">qui</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-ita/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>S.M.S. ver 1.0 &#8211; Video</title>
		<link>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-video/</link>
		<comments>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-video/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 15:44:58 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[S.M.S. ver 1.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=65</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://www.youtube.com/embed/3phmckSinxg" frameborder="0" width="425" height="349"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S.M.S. ver 1.0 &#8211; Gallery</title>
		<link>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-gallery/</link>
		<comments>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-gallery/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 15:17:58 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[S.M.S. ver 1.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=54</guid>
		<description><![CDATA[The “core”: LCD on top, buttons on right-top corner, light and contrast trimmers on right, LCD shield in the center, Arduino on the background and visible on left. All switched off and closed. On top, buttons. Main screen, full brightness. All fed with a 8.4V/170mA battery!]]></description>
			<content:encoded><![CDATA[<ol>
<li>The “core”: LCD on top, buttons on right-top corner, light and contrast trimmers on right, LCD shield in the center, Arduino on the background and visible on left.</li>
<li>All switched off and closed.</li>
<li>On top, buttons.</li>
<li>Main screen, full brightness.</li>
<li>All fed with a 8.4V/170mA battery!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S.M.S. ver 1.0 &#8211; Eng &#8211; How To</title>
		<link>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-eng-how-to/</link>
		<comments>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-eng-how-to/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 14:59:25 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[S.M.S. ver 1.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=48</guid>
		<description><![CDATA[&#160; [Update: the S.M.S. has been upgraded, read this] This post is about what is it and how it&#8217;s done the S.M.S. First of all S.M.S. is for Scatola Magica della Solitudine [eng: Magic Box of Loneliness] and it&#8217;s a gift for my girlfriend, who studies and lives out of our city 5 day a &#8230;]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong>[Update: the S.M.S. has been upgraded, read <a title="Spoka Box – S.M.S. ver 2.0 – Eng" href="http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-eng/" target="_blank">this</a>]</strong></p>
<p>This post is about what is it and how it&#8217;s done the S.M.S.</p>
<p>First of all S.M.S. is for Scatola Magica della Solitudine [eng: Magic Box of Loneliness] and it&#8217;s a gift for my girlfriend, who studies and lives out of our city 5 day a week.<br />
The goal was to give her a present to remember me and don’t feel loneliness. It can shows some random sentences to encourage her and a simple romantic &#8220;cartoon&#8221;.</p>
<p><strong>Features</strong></p>
<ul>
<li>random sentences</li>
<li>cartoon</li>
<li>some images</li>
</ul>
<p><em>Random sentences</em><br />
It shows a sentence from a list.</p>
<p><em>Cartoon</em><br />
It shows a short lovely animation.<br />
It uses a matrix of the positions of every single elements of the cartoon.</p>
<p><em>Some images</em><br />
They are bmp images coded into hexadecimal values and memorized into Arduino sketch.</p>
<p><strong>How it&#8217;s done</strong></p>
<p><em>Components</em></p>
<ul>
<li><a title="Arduino Site" href="http://www.arduino.cc/" target="_blank">Arduino</a>,</li>
<li><a title="Product" href="http://www.sparkfun.com/commerce/product_info.php?products_id=710" target="_blank">graphic LCD</a>,</li>
<li>LCD shield (by me),</li>
<li>2 buttons,</li>
<li>2 trimmers,</li>
<li>mini breadboard,</li>
<li>1 electric box.</li>
</ul>
<p>You can find the code and some information about LCD <a title="GLCD playground" href="http://www.arduino.cc/playground/Code/GLCDks0108" target="_blank">here</a>.</p>
<p>Some functions and menus code snippet.</p>
<ul>
<li><em>Loop.</em></li>
</ul>
<pre>
void Start(){
GLCD.ClearScreen();
GLCD.CursorTo(0,2);
GLCD.Puts("Ciao!");
GLCD.CursorTo(0,5);
GLCD.Puts("Premi un pulsante..");
}

void Menu_Opts_1(){
GLCD.ClearScreen();
GLCD.CursorTo(3,1);
GLCD.Puts("Menu Opzioni 1:");
GLCD.CursorTo(0,3);
GLCD.Puts("Premi pulsante 1 x cartoon.");
GLCD.CursorTo(0,5);
GLCD.Puts("Premi pulsante 2 x frasi.");
}

void Menu_Opts_2(){
GLCD.ClearScreen();
GLCD.CursorTo(3,1);
GLCD.Puts("Menu Opzioni 2:");
GLCD.CursorTo(0,3);
GLCD.Puts("Premi pulsante 1 x cartoon.");
GLCD.CursorTo(0,5);
GLCD.Puts("Premi pulsante 2 x frasi.");
}

void loop(){
button1State = digitalRead(button1Pin);
button2State = digitalRead(button2Pin);

//============== MENU 0 - Main Screen ================
if(menu == 0 &amp;&amp; button1State == HIGH){
menu = 1;
Menu_Opts_1();
}
if(menu == 0 &amp;&amp; button2State == HIGH){
menu = 2;
Menu_Opts_2();
}

//============== MENU 1 - Options Screen ================
if(menu == 1 &amp;&amp; button1State == HIGH){
menu = 0;
Cartoon();
EndAnim();
Start();
}
if(menu == 1 &amp;&amp; button2State == HIGH){
menu = 0;
Sentence();
Start();
}

//============== MENU 2 - Options Screen ================
if(menu == 2 &amp;&amp; button1State == HIGH){
menu = 0;
// Something to do.
}
if(menu == 2 &amp;&amp; button2State == HIGH){
menu = 0;
// Something to do.
}
}
</pre>
<ul>
<li><em>Function to display the random sentence</em></li>
</ul>
<pre>void Sentence(){
int RandBtn2Count = 0;
RandBtn2Count=random(1,7);

GLCD.ClearScreen();

switch (RandBtn2Count){
//--------------------------------------//
//******* FRASE 1 *******//
case 1:
GLCD.CursorTo(0,1);
GLCD.Puts("text");
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(1,4);
GLCD.Puts("text");
GLCD.CursorTo(2,5);
GLCD.Puts("text!");
break;
//--------------------------------------//
//******* FRASE 2 *******//
case 2:
GLCD.CursorTo(0,1);
GLCD.Puts("text");
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(0,4);
GLCD.Puts("text!!");
GLCD.CursorTo(0,5);
GLCD.Puts("text!!");
break;
//--------------------------------------//
//******* FRASE 3 *******//
case 3:
//GLCD.CursorTo(0,1);
//GLCD.Puts("3");
GLCD.DrawBitmap(cuore, 30,0, BLACK);
break;
//------------------------------------------//
//******* FRASE 4 *******//
case 4:
GLCD.CursorTo(0,1);
GLCD.Puts("text!");
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(0,4);
GLCD.Puts("text");
GLCD.CursorTo(0,5);
GLCD.Puts("text!");
delay(5000);
GLCD.DrawBitmap(smile, 32,0, BLACK);
break;
//-----------------------------------------//
//******* FRASE 5 *******//
case 5:
GLCD.CursorTo(9,3);
GLCD.Puts("text!");
break;
//-----------------------------------------//
//******* FRASE 6 *******//
case 6:
//Cartoon();
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(0,4);
GLCD.Puts("text!!");
break;
//-----------------------------------------//
//******* DEFAULT *******//
default:
GLCD.CursorTo(0,1); // go to 2nd line, 1st column
GLCD.Puts("Ops!");
GLCD.CursorTo(0,3);
GLCD.Puts("c'e' stato un errore..");
break;
}
delay(5000);
}</pre>
<ul>
<li><em>Cartoon function</em></li>
</ul>
<pre>
void Cartoon(){
/* matrice per le mosse
move[i][j]=[x,y]
Mossa i-esima, variabile j-esima.
*/
int move[7][6];
// x1,y1,x2,y2,arm1,arm2
int move_0[6]={25,15,56,15,0,0};
int move_1[6]={27,15,56,15,0,0};
int move_2[6]={29,15,56,15,0,1};
int move_3[6]={33,15,56,15,0,1};
int move_4[6]={36,15,56,15,0,1};
int move_5[6]={40,15,56,15,1,1};
int move_6[6]={43,15,56,15,1,1};
int move_7[6]={46,15,56,15,1,1};

for(int j=0;j&lt;8;j++){
for(int i=0;i&lt;7;i++){
switch (j){
case 0:
move[j][i]=move_0[i];
break;
case 1:
move[j][i]=move_1[i];
break;
case 2:
move[j][i]=move_2[i];
break;
case 3:
move[j][i]=move_3[i];
break;
case 4:
move[j][i]=move_4[i];
break;
case 5:
move[j][i]=move_5[i];
break;
case 6:
move[j][i]=move_6[i];
break;
case 7:
move[j][i]=move_7[i];
break;
}
}
}

for(int i=0;i&lt;8;i++){
GLCD.ClearScreen();
// Heads
GLCD.DrawCircle(move[i][0],move[i][1],5,BLACK);
GLCD.DrawCircle(move[i][2],move[i][3],5,BLACK);
// Body left person
GLCD.DrawLine(move[i][0],move[i][1]+5,move[i][0],move[i][1]+15, BLACK);
if(move[i][4]==1){
// Arm left person
GLCD.DrawLine(move[i][0],move[i][1]+8,move[i][0]+5,move[i][1]+5,BLACK);
}
// Body and foots right person
GLCD.DrawLine(move[i][2],move[i][3]+5,move[i][2],move[i][3]+15, BLACK);
GLCD.DrawLine(move[i][2],move[i][3]+15,move[i][2]+3,move[i][3]+20, BLACK);
GLCD.DrawLine(move[i][2]-1,move[i][3]+15,move[i][2]-3,move[i][3]+20, BLACK);
if(move[i][5]==1){
// Arm right person
GLCD.DrawLine(move[i][2],move[i][3]+8,move[i][2]-5,move[i][3]+5,BLACK);
}
// Foots left person
GLCD.DrawLine(move[i][0]+1,move[i][1]+15,move[i][0]+3,move[i][1]+20,BLACK);
GLCD.DrawLine(move[i][0],move[i][1]+15,move[i][0]-3,move[i][1]+20,BLACK);
delay(1500);
}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-eng-how-to/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>S.M.S. ver 1.0 &#8211; Ita &#8211; How To</title>
		<link>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-ita-how-to/</link>
		<comments>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-ita-how-to/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 14:19:24 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[S.M.S. ver 1.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=20</guid>
		<description><![CDATA[&#160; [Update: la S.M.S. ha subito un restyling ed un upgrade, trovate tutto qui] Questo post mostra cosa è e come è stata realizzata la S.M.S.. Innanzi tutto S.M.S. significa Scatola Magica della Solitudine ed è stata realizzata come regalo per la mia ragazza, che studia e vive 5 giorni su 7 fuori città. Funzionalità frasi &#8230;]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong>[Update: la S.M.S. ha subito un restyling ed un upgrade, trovate tutto <a title="Spoka Box – S.M.S. ver 2.0 – Ita – How To" href="http://www.saki-kawa.com/techportfolio/spoka-box-s-m-s-ver-2-0-ita-how-to/">qui</a>]</strong></p>
<p>Questo post mostra cosa è e come è stata realizzata la S.M.S..</p>
<p>Innanzi tutto S.M.S. significa Scatola Magica della Solitudine ed è stata realizzata come regalo per la mia ragazza, che studia e vive 5 giorni su 7 fuori città.</p>
<p><strong>Funzionalità</strong></p>
<ul>
<li>frasi casuali</li>
<li>cartoon</li>
<li>immagini varie</li>
</ul>
<p><em>Frasi casuali</em><br />
Mostra una frase casuale tra una ventina memorizzate.</p>
<p><em>Cartoon</em><br />
Mostra una breve animazione romantica.<br />
E&#8217; stata realizzata creando delle matrici delle posizioni dei singoli elementi, che vengono ciclate e permettono il movimento dei personaggi del cartone.</p>
<p><em>Immagini varie</em><br />
Sono delle semplici bmp convertite in esadecimale ed inserite direttamente nella memoria di Arduino.</p>
<p><strong>Come è stata fatta</strong></p>
<p><em>Componenti</em></p>
<ul>
<li><span class="Apple-style-span" style="font-weight: 300;"><a title="Arduino Site" href="http://www.arduino.cc/" target="_blank">Arduino</a>,</span></li>
<li><span class="Apple-style-span" style="font-weight: 300;"><a title="Product" href="http://www.sparkfun.com/commerce/product_info.php?products_id=710" target="_blank">LCD grafico</a>,</span></li>
<li><span class="Apple-style-span" style="font-weight: 300;">shield per LCD (fatto da me),</span></li>
<li><span class="Apple-style-span" style="font-weight: 300;">2 pulsanti,</span></li>
<li><span class="Apple-style-span" style="font-weight: 300;">2 trimmer,</span></li>
<li><span class="Apple-style-span" style="font-weight: 300;">mini breadboard,</span></li>
<li><span class="Apple-style-span" style="font-weight: 300;">1 box per impiantistica.</span></li>
</ul>
<p>Il codice e le informazioni sull&#8217;LCD le potete trovare <a title="GLCD playground" href="http://www.arduino.cc/playground/Code/GLCDks0108" target="_blank">qui</a>.</p>
<p>Ecco alcune snippet di codice delle funzioni e dei menu.</p>
<ul>
<li><span class="Apple-style-span" style="font-weight: 300;"><em>Loop.</em></span></li>
</ul>
<pre>
void Start(){
GLCD.ClearScreen();
GLCD.CursorTo(0,2);
GLCD.Puts("Ciao!");
GLCD.CursorTo(0,5);
GLCD.Puts("Premi un pulsante..");
}

void Menu_Opts_1(){
GLCD.ClearScreen();
GLCD.CursorTo(3,1);
GLCD.Puts("Menu Opzioni 1:");
GLCD.CursorTo(0,3);
GLCD.Puts("Premi pulsante 1 x cartoon.");
GLCD.CursorTo(0,5);
GLCD.Puts("Premi pulsante 2 x frasi.");
}

void Menu_Opts_2(){
GLCD.ClearScreen();
GLCD.CursorTo(3,1);
GLCD.Puts("Menu Opzioni 2:");
GLCD.CursorTo(0,3);
GLCD.Puts("Premi pulsante 1 x cartoon.");
GLCD.CursorTo(0,5);
GLCD.Puts("Premi pulsante 2 x frasi.");
}

void loop(){
button1State = digitalRead(button1Pin);
button2State = digitalRead(button2Pin);

//============== MENU 0 - Main Screen ================
if(menu == 0 &amp;&amp; button1State == HIGH){
menu = 1;
Menu_Opts_1();
}
if(menu == 0 &amp;&amp; button2State == HIGH){
menu = 2;
Menu_Opts_2();
}

//============== MENU 1 - Options Screen ================
if(menu == 1 &amp;&amp; button1State == HIGH){
menu = 0;
Cartoon();
EndAnim();
Start();
}
if(menu == 1 &amp;&amp; button2State == HIGH){
menu = 0;
Sentence();
Start();
}

//============== MENU 2 - Options Screen ================
if(menu == 2 &amp;&amp; button1State == HIGH){
menu = 0;
// Something to do.
}
if(menu == 2 &amp;&amp; button2State == HIGH){
menu = 0;
// Something to do.
}
}
</pre>
<ul>
<li><span class="Apple-style-span" style="font-weight: 300;"><em>Funzione per stampare a video una frase casuale.</em></span></li>
</ul>
<pre>void Sentence(){
int RandBtn2Count = 0;
RandBtn2Count=random(1,7);

GLCD.ClearScreen();

switch (RandBtn2Count){
//--------------------------------------//
//******* FRASE 1 *******//
case 1:
GLCD.CursorTo(0,1);
GLCD.Puts("text");
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(1,4);
GLCD.Puts("text");
GLCD.CursorTo(2,5);
GLCD.Puts("text!");
break;
//--------------------------------------//
//******* FRASE 2 *******//
case 2:
GLCD.CursorTo(0,1);
GLCD.Puts("text");
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(0,4);
GLCD.Puts("text!!");
GLCD.CursorTo(0,5);
GLCD.Puts("text!!");
break;
//--------------------------------------//
//******* FRASE 3 *******//
case 3:
//GLCD.CursorTo(0,1);
//GLCD.Puts("3");
GLCD.DrawBitmap(cuore, 30,0, BLACK);
break;
//------------------------------------------//
//******* FRASE 4 *******//
case 4:
GLCD.CursorTo(0,1);
GLCD.Puts("text!");
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(0,4);
GLCD.Puts("text");
GLCD.CursorTo(0,5);
GLCD.Puts("text!");
delay(5000);
GLCD.DrawBitmap(smile, 32,0, BLACK);
break;
//-----------------------------------------//
//******* FRASE 5 *******//
case 5:
GLCD.CursorTo(9,3);
GLCD.Puts("text!");
break;
//-----------------------------------------//
//******* FRASE 6 *******//
case 6:
//Cartoon();
GLCD.CursorTo(0,3);
GLCD.Puts("text");
GLCD.CursorTo(0,4);
GLCD.Puts("text!!");
break;
//-----------------------------------------//
//******* DEFAULT *******//
default:
GLCD.CursorTo(0,1); // go to 2nd line, 1st column
GLCD.Puts("Ops!");
GLCD.CursorTo(0,3);
GLCD.Puts("c'e' stato un errore..");
break;
}
delay(5000);
}</pre>
<ul>
<li><span class="Apple-style-span" style="font-weight: 300;"><em>Funzione per il cartone.</em></span></li>
</ul>
<pre>
void Cartoon(){
/* matrice per le mosse
move[i][j]=[x,y]
Mossa i-esima, variabile j-esima.
*/
int move[7][6];
// x1,y1,x2,y2,arm1,arm2
int move_0[6]={25,15,56,15,0,0};
int move_1[6]={27,15,56,15,0,0};
int move_2[6]={29,15,56,15,0,1};
int move_3[6]={33,15,56,15,0,1};
int move_4[6]={36,15,56,15,0,1};
int move_5[6]={40,15,56,15,1,1};
int move_6[6]={43,15,56,15,1,1};
int move_7[6]={46,15,56,15,1,1};

for(int j=0;j&lt;8;j++){
for(int i=0;i&lt;7;i++){
switch (j){
case 0:
move[j][i]=move_0[i];
break;
case 1:
move[j][i]=move_1[i];
break;
case 2:
move[j][i]=move_2[i];
break;
case 3:
move[j][i]=move_3[i];
break;
case 4:
move[j][i]=move_4[i];
break;
case 5:
move[j][i]=move_5[i];
break;
case 6:
move[j][i]=move_6[i];
break;
case 7:
move[j][i]=move_7[i];
break;
}
}
}

for(int i=0;i&lt;8;i++){
GLCD.ClearScreen();
// Heads
GLCD.DrawCircle(move[i][0],move[i][1],5,BLACK);
GLCD.DrawCircle(move[i][2],move[i][3],5,BLACK);
// Body left person
GLCD.DrawLine(move[i][0],move[i][1]+5,move[i][0],move[i][1]+15, BLACK);
if(move[i][4]==1){
// Arm left person
GLCD.DrawLine(move[i][0],move[i][1]+8,move[i][0]+5,move[i][1]+5,BLACK);
}
// Body and foots right person
GLCD.DrawLine(move[i][2],move[i][3]+5,move[i][2],move[i][3]+15, BLACK);
GLCD.DrawLine(move[i][2],move[i][3]+15,move[i][2]+3,move[i][3]+20, BLACK);
GLCD.DrawLine(move[i][2]-1,move[i][3]+15,move[i][2]-3,move[i][3]+20, BLACK);
if(move[i][5]==1){
// Arm right person
GLCD.DrawLine(move[i][2],move[i][3]+8,move[i][2]-5,move[i][3]+5,BLACK);
}
// Foots left person
GLCD.DrawLine(move[i][0]+1,move[i][1]+15,move[i][0]+3,move[i][1]+20,BLACK);
GLCD.DrawLine(move[i][0],move[i][1]+15,move[i][0]-3,move[i][1]+20,BLACK);
delay(1500);
}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-ita-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S.M.S. ver 1.0 &#8211; Ita &amp; Eng &#8211; Schema</title>
		<link>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-ita-eng-schema/</link>
		<comments>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-ita-eng-schema/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 11:07:52 +0000</pubDate>
		<dc:creator>saki_kawa</dc:creator>
				<category><![CDATA[S.M.S. ver 1.0]]></category>

		<guid isPermaLink="false">http://www.saki-kawa.com/techportfolio/?p=9</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.saki-kawa.com/techportfolio/s-m-s-ver-1-0-ita-eng-schema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

