<?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>chemicaloliver &#187; Processing</title>
	<atom:link href="http://chemicaloliver.net/category/processing/feed/" rel="self" type="application/rss+xml" />
	<link>http://chemicaloliver.net</link>
	<description>experimentation, criticism and geekiness</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:21:33 +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>Controlling lights with TI ez430 chronos, home easy, arduino and processing</title>
		<link>http://chemicaloliver.net/arduino/controlling-lights-with-ti-ez430-chronos-home-easy-arduino-and-processing/</link>
		<comments>http://chemicaloliver.net/arduino/controlling-lights-with-ti-ez430-chronos-home-easy-arduino-and-processing/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:17:28 +0000</pubDate>
		<dc:creator>chemicaloliver</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://chemicaloliver.net/?p=348</guid>
		<description><![CDATA[Now that the protocol for basic communication with the TI chronos ez430 has been worked out (see previous posts) I needed to work on something useful. So I set out to try and control my wireless light switch with the watch. Sadly the RF receiver supplied with the chronos does not use a protocol which is likely to ever [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the protocol for basic communication with the TI chronos ez430 has been worked out (see previous posts) I needed to work on something useful. So I set out to try and control my wireless light switch with the watch. Sadly the RF receiver supplied with the chronos does not use a protocol which is likely to ever be compatible with the arduino so this example requires a computer.</p>
<h4>The Hardware</h4>
<p>Recently I&#8217;ve acquired a Home Easy HE217 remote light switch which consists of a unit placed between the light bulb and ceiling rose and a wireless switch to switch the light on and off from anywhere within about 10m. I purchased this with some form of hackery in mind but this is the first real attempt to do anything useful outside of the functionality of the supplied package. The system uses RF at 433MHz and a simple authentication protocol, which is conveniently documented at the <a href="http://homeeasyhacking.wikia.com/wiki/Home_Easy_Hacking_Wiki">Home Easy Hacking Wiki</a>.</p>
<p style="text-align: center;"><img class="size-full wp-image-349 aligncenter" title="Home Easy HE217" src="http://chemicaloliver.net/wordpress/wp-content/uploads/2010/02/311773168_tp.jpg" alt="Home Easy HE217" width="400" height="266" /><br />
<span id="more-348"></span><br />
433MHz is a common frequency used by radio controlled devices such as remote switches, garage doors and car remote controls and transmitters and receivers are readily <a href="http://www.seeedstudio.com/depot/433mhz-rf-link-kit-p-127.html?cPath=2">available for very little money (around $5)</a>. These can be used for many uses especially in combination with an <a href="http://arduino.cc">arduino</a>, following on from the work documented on the <a href="http://homeeasyhacking.wikia.com/wiki/Home_Easy_Hacking_Wiki">Home Easy Hacking Wiki</a> an arduino library has been produced (<a href="http://www.arduino.cc/playground/Code/HomeEasy">available here</a>). This allows the arduino to control the light switch in the same way as the provided Home Easy light switch.</p>
<p style="text-align: center;"><a href="http://chemicaloliver.net/wordpress/wp-content/uploads/2010/02/rf.jpg"><img class="size-full wp-image-353 aligncenter" title="Seeeduino 433MHz RF Transmitter" src="http://chemicaloliver.net/wordpress/wp-content/uploads/2010/02/rf.jpg" alt="Seeeduino 433MHz RF Transmitter" width="380" height="340" /></a></p>
<p>The RF transmitter was then simply connected to the arduino to allow the light switch to be controlled using the arduino.</p>
<h4>The software</h4>
<p>The software aspect of this project consists of my <a href="http://chemicaloliver.net/programming/receiving-ti-ez430-chronos-button-presses-in-processing-and-python/">previous processing sketch</a> which receives button presses from the chronos watch, to this I added functionality so that every time a button press is received a serial character is sent to the arduino in this case H for on and L for off.</p>
<p>On the arduino a sketch is used that reads the serial input and when H or L is received it send an on or off message using the <a href="http://www.arduino.cc/playground/Code/HomeEasy">home easy arduino library</a> thus switching the light. The observant among you will have noticed that this is based on the <a href="http://www.arduino.cc/en/Tutorial/PhysicalPixel">arduino physical pixel example</a>!</p>
<p>The system works even if the watch is taken out of transmit mode and then restarted.</p>
<p>The code can be viewed below.</p>
<p style="text-align: center;"><a href="http://chemicaloliver.net/images/rfard.jpg"><img class="size-full wp-image-355 aligncenter" title="Arduino RF transmitter circuit" src="http://chemicaloliver.net/wordpress/wp-content/uploads/2010/02/rfardt.jpg" alt="Arduino RF transmitter circuit" width="380" height="388" /></a></p>
<h4>In action</h4>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/j2_NBuWCztk&amp;hl=en_GB&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/j2_NBuWCztk&amp;hl=en_GB&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h4>The code</h4>
<p>The processing sketch <a href="http://chemicaloliver.net/code/chronoslight.pde">chronoslight.pde</a></p>
<p>The arduino sketch: <a href="http://chemicaloliver.net/code/chronosHE.pde">chronosHE.pde</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chemicaloliver.net/arduino/controlling-lights-with-ti-ez430-chronos-home-easy-arduino-and-processing/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Receiving TI ez430 Chronos Button Presses in Processing (and Python)</title>
		<link>http://chemicaloliver.net/hardware/receiving-ti-ez430-chronos-button-presses-in-processing-and-python/</link>
		<comments>http://chemicaloliver.net/hardware/receiving-ti-ez430-chronos-button-presses-in-processing-and-python/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:10:08 +0000</pubDate>
		<dc:creator>chemicaloliver</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[TI chronos]]></category>

		<guid isPermaLink="false">http://chemicaloliver.net/?p=322</guid>
		<description><![CDATA[Another currently badly documented feature of the chronos is the facility to get button presses from the watch when in Powerpoint (PPT) mode, so again after a code example from Sean Brewer (available below) I&#8217;ve produced a processing version. The process of acquiring the data, the same request string is sent however in PPT mode the return [...]]]></description>
			<content:encoded><![CDATA[<p>Another currently badly documented feature of the chronos is the facility to get button presses from the watch when in Powerpoint (PPT) mode, so again after a code example from Sean Brewer (available below) I&#8217;ve produced a processing version.</p>
<p style="text-align: center;"><a href="http://chemicaloliver.net/images/chronosbutton.png"><img class="size-full wp-image-323 aligncenter" title="Chronos button processing sketch" src="http://chemicaloliver.net/wordpress/wp-content/uploads/2010/02/chronosbuttont.png" alt="" width="380" height="259" /></a></p>
<p>The process of acquiring the data, the same request string is sent however in PPT mode the return is different, the third byte determining which button has been pressed in the case of my watch the buttons return the values below:<br />
<span id="more-322"></span><br />
Top left: 18</p>
<p>Top right: 50</p>
<p>Bottom left: 34</p>
<p>However these are different to the values Sean found, his being one less in each case (i.e. 17,49 and 33) so some experimentation may be required.</p>
<p><em>Update: A kind commenter has pointed out that in PPT mode the values are as I listed, and in ACC mode they are the lower values.</em></p>
<h4>Code</h4>
<p>Original python code: <a href="http://chemicaloliver.net/code/chronosbuttono.py">chronosbuttono.py</a> (originally posted here <a href="http://pastebin.com/m5d1b7ced">http://pastebin.com/m5d1b7ced</a> however doesn&#8217;t seem to work with my watch)</p>
<p>My working python code: <a href="http://chemicaloliver.net/code/chronosbutton.py">chronosbutton.py</a></p>
<p>My processing sketch: <a href="http://chemicaloliver.net/code/chronosbutton.pde">chronosbutton.pde</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chemicaloliver.net/hardware/receiving-ti-ez430-chronos-button-presses-in-processing-and-python/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Graphing ti ez430 Chronos watch data in Processing</title>
		<link>http://chemicaloliver.net/hardware/graphing-ti-ez430-chronos-watch-data-in-processing/</link>
		<comments>http://chemicaloliver.net/hardware/graphing-ti-ez430-chronos-watch-data-in-processing/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 12:42:45 +0000</pubDate>
		<dc:creator>chemicaloliver</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://chemicaloliver.net/?p=307</guid>
		<description><![CDATA[Thanks to a helpful comment on my previous post Graphing ti ez430 Chronos watch data in Linux Sean Brewer posted the help I&#8217;d been looking for to get the chronos working with processing. Following on from the sample code posted by Sean (pastebin or my mirror) I have made the code into a more conventional processing style [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to a helpful comment on my previous post <a href="http://chemicaloliver.net/programming/graphing-ti-ez430-chronos-watch-data-in-linux/">Graphing ti ez430 Chronos watch data in Linux</a> Sean Brewer posted the help I&#8217;d been looking for to get the chronos working with <a href="http://processing.org/">processing</a>.</p>
<p style="text-align: center;"><a href="http://chemicaloliver.net/images/chronosxyz.png"><img class="aligncenter" title="TI Chronos processing data" src="http://chemicaloliver.net/images/chronosxyzt.png" alt="" width="380" height="354" /></a></p>
<p>Following on from the sample code posted by Sean (<a href="http://pastebin.com/f210226f8">pastebin</a> or <a href="http://chemicaloliver.net/code/chronos.pde">my mirror</a>) I have made the code into a more conventional processing style and added simple graphing functionality in processing to allow the simultaneous graphing of xyz data and my updated code can be found below.<br />
<span id="more-307"></span><br />
Using processing seems to perform slightly less well than python as it is slower and less data arrives marked as valid (any thoughts on why this is would be appreciated as always) but still provides a workable system. It does seem to be linked to problems I was having implementing this, where the data appeared jumbled, at that time I wasn&#8217;t aware of the validation byte.</p>
<h4>Code</h4>
<p><a href="http://chemicaloliver.net/code/chronosgraph.pde">chronosgraph.pde</a> &#8211; sketch to take data and graph it</p>
<p><a href="http://chemicaloliver.net/code/chronos.pde">chronos.pde</a> - original  sketch which just gets data (Sean Brewer)</p>
]]></content:encoded>
			<wfw:commentRss>http://chemicaloliver.net/hardware/graphing-ti-ez430-chronos-watch-data-in-processing/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Graphing ti ez430 Chronos watch data in Linux</title>
		<link>http://chemicaloliver.net/arduino/graphing-ti-ez430-chronos-watch-data-in-linux/</link>
		<comments>http://chemicaloliver.net/arduino/graphing-ti-ez430-chronos-watch-data-in-linux/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 17:17:14 +0000</pubDate>
		<dc:creator>chemicaloliver</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[processing controlp5]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[TI chronos]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chemicaloliver.net/?p=295</guid>
		<description><![CDATA[Recently my Texas Instruments ez430 Chronos watch arrived, I preordered it the day I read about it on engadget back in November 2009, so it was nice to receive it after all this time. As a dedicated Linux user I found it disappointing that there was little in the way of Linux support provided by [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://chemicaloliver.net/images/chronosw.jpg"><img class="aligncenter" title="TI Cronos ez-430" src="http://chemicaloliver.net/images/chronoswt.jpg" alt="" width="380" height="337" /></a></p>
<p style="text-align: left;">Recently my <a href="http://www.ti-estore.com/Merchant2/merchant.mvc?Screen=PROD&amp;Product_Code=eZ430-Chronos-868">Texas Instruments ez430 Chronos </a>watch arrived, I preordered it the day I read about it on engadget back in November 2009, so it was nice to receive it after all this time. As a dedicated Linux user I found it disappointing that there was little in the way of Linux support provided by TI, however this was not unexpected and a linux application is currently being developed, although progress seems to be somewhat slow. However in the last week breakthroughs have been made, <a href="http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/32714.aspx">uguryildiz in a post on the TI forum</a> revealed the protocol used to request data from the acceleration sensors and also for setting of the time allowing custom applications to be built using this data on Linux or any other operating system able to use usb serial.</p>
<p><span id="more-295"></span></p>
<p>Example code in python was also posted <a href="http://pastebin.com/fde255fd">here</a>, basically the protocol for getting the accelerometer data is very simple:</p>
<ul>
<li>After connecting the RF USB dongle supplied with the watch and putthe watch into ACC transmit mode and connect to the serial port /dev/ACM0 (on linux) with baud of 115200</li>
<li>Send the hex string: 0xFF 0&#215;07 0&#215;03 to open a connection with the watch, it should reply 0xFF 0&#215;06 0&#215;03 to confirm a connection has been made</li>
<li>Accelerometer data can then be requested by sending 0xFF, 0&#215;08, 0&#215;07, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00</li>
<li>The watch will then return seven bytes back in the form ff 06 07 tt xx yy zz where the last three bytes are the accelerometer values.</li>
</ul>
<p style="text-align: center;"><a href="http://chemicaloliver.net/images/chronos.jpg"><img class="aligncenter" title="Chronos Sensor Graph" src="http://chemicaloliver.net/images/chronost.jpg" alt="" width="380" height="337" /></a></p>
<p>As a simple experiment I used the afore mentioned python code to get data from the watch and then combined this with a graphing gui example kindly posted by <a href="http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/">Eli Bendersky</a> to make an application which uses matplotlib produce a live graph of the data (currently only one axis at a time).</p>
<p>My code can be downloaded here: <a href="http://chemicaloliver.net/code/chronos_graph.py">chronos_graph.py</a></p>
<p>It should be noted that this code is very much hacked together, I am not a python coder and have never written anything in python before in my life, but it should work.</p>
<p>I am currently working on trying to get this working with processing and arduino, however serial communication from processing with the watch is proving troublesome so I reverted to python for this example.</p>
]]></content:encoded>
			<wfw:commentRss>http://chemicaloliver.net/arduino/graphing-ti-ez430-chronos-watch-data-in-linux/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>writing a GUI in processing</title>
		<link>http://chemicaloliver.net/processing/writing-a-gui-in-processing/</link>
		<comments>http://chemicaloliver.net/processing/writing-a-gui-in-processing/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 18:26:55 +0000</pubDate>
		<dc:creator>chemicaloliver</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[processing controlp5]]></category>

		<guid isPermaLink="false">http://wordpress.chemicaloliver.net/?p=51</guid>
		<description><![CDATA[When I first started looking into the Processing language it is quickly apparent that out of the box there is very little in the way of handling user input by way of GUIs. This has been rectified in a very nice way by the team who developed controlP5 this is in my opinion the easiest [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started looking into the <a href="http://processing.org/">Processing language</a> it is quickly apparent that out of the box there is very little in the way of handling user input by way of GUIs. This has been rectified in a very nice way by the team who developed <a href="http://www.sojamo.de/libraries/controlP5/">controlP5 </a> this is in my opinion the easiest GUI library I&#8217;ve ever used enabling me to create sliders and knobs in a matter of minutes, having programmed very little in processing before. What I came up with is the start of the interface for my planned ardunio controlled synth system:</p>
<p style="text-align: center;"><img class="aligncenter" title="Processing GUI example" src="http://chemicaloliver.net/images/example1.jpg" alt="" width="397" height="195" /></p>
<p><span id="more-51"></span><br />
<code><br />
import controlP5.*;<br />
</code><br />
<code>ControlP5 controlP5;<br />
int myColorBackground = color(0,0,0);</code></p>
<p><code>void setup() {<br />
size(400,200);<br />
controlP5 = new ControlP5(this);<br />
controlP5.addSlider("Pitch",0,100,50,50,50,10,100);<br />
controlP5.addSlider("LFO",0,100,50,150,50,10,100);<br />
controlP5.addSlider("Duty Cycle",0,100,50,250,50,10,100);<br />
controlP5.addKnob("Volume",0,11,5,330,70,40);<br />
}</code></p>
<p><code>void draw() {<br />
background(myColorBackground);<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://chemicaloliver.net/processing/writing-a-gui-in-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

