<?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>MarcAThing.com &#187; iobridge</title>
	<atom:link href="http://www.marcathing.com/category/iobridge/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcathing.com</link>
	<description>&#34;physically mashed-up&#34;</description>
	<lastBuildDate>Sat, 08 Aug 2009 17:12:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pure HTML ioBridge Proxy example (no javascript)</title>
		<link>http://www.marcathing.com/2009/06/24/pure-html-iobridge-proxy-example-no-javascript-at-all/</link>
		<comments>http://www.marcathing.com/2009/06/24/pure-html-iobridge-proxy-example-no-javascript-at-all/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 20:20:47 +0000</pubDate>
		<dc:creator>Marc Fonteijn</dc:creator>
				<category><![CDATA[iobridge]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://www.marcathing.com/?p=204</guid>
		<description><![CDATA[I described earlier how you can use the ioBridge proxy as an easy API to control your ioBridge module with anything that can make a http call. The examples I in that post and also in the one on how to control your Serial LCD both utilize Javascript. There might be situations where you can&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I described earlier how you can use the <a href="http://www.marcathing.com/2009/06/21/an-easy-api-for-the-iobrigde-to-use-with-ajax-php-java-phyton-etc/">ioBridge proxy</a> as an easy API to control your ioBridge module with anything that can make a http call. The examples I in that post and also in the one on how to <a href="http://www.marcathing.com/2009/06/21/controlling-the-sparkfuncom-serial-lcd-hd44780-using-your-iobridge/">control your Serial LCD</a> both utilize Javascript. There might be situations where you can&#8217;t (or don&#8217;t want to) use Javascript, for instance on an phone with an outdated browser. The good thing about the ioBridge proxy is that you don&#8217;t have to use javascript at all, just create correctly formed urls to control the ioBridge module.</p>
<p>There are just 3 url&#8217;s that let you control everything:</p>
<ul>
<li><em>Execute widget / get value:</em> http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx</li>
<li><em>Set the digital output state of a widget:</em> http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&#038;state=[0|1]</li>
<li><em>Set the value of a serial widget:</em> http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&#038;value=somevalue</li>
</ul>
<p>I&#8217;ve created an example that uses only plain HTML. The examples uses an iFrame as target for the links, this prevents the browser from navigating away from the current page.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>ioBridge Proxy API example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>execute<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>getValue<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&amp;state=1&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>setState(on)<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&amp;state=0&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>setState(off)<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>      
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&amp;value=abcd&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>setValue<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">iframe</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>Your browser does not support iframes. Too bad for you.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">iframe</span>&gt;</span> 
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>And here&#8217;s a example on how to control the LCD just by using HTML.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>ioBridge Serial LCD control<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
      textarea {
        color: #8DF; 
        background-color: #023; 
        padding: 0.25em;
        margin: 0em;
        line-height: 1.2em;
        border: 1px solid #000; 
        font-size: 36px; 
        font-family: monospace;
      }
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;get&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> row<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">cols</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;value&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;widgetID&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;xxxxxxxxxxxx&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>          
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>          
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pane&quot;</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>General<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&amp;value=%FE%01&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>clear screen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&amp;value=%7C%9D%FE%0C&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>LCD on<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://yourserver.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx&amp;value=%7C%80%FE%08&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>LCD off<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">iframe</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;placeholder&quot;</span>&gt;</span>Your browser does not support iframes. Too bad for you.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">iframe</span>&gt;</span> 
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.marcathing.com/2009/06/24/pure-html-iobridge-proxy-example-no-javascript-at-all/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Controlling the SparkFun.com Serial LCD (HD44780) using your ioBridge</title>
		<link>http://www.marcathing.com/2009/06/21/controlling-the-sparkfuncom-serial-lcd-hd44780-using-your-iobridge/</link>
		<comments>http://www.marcathing.com/2009/06/21/controlling-the-sparkfuncom-serial-lcd-hd44780-using-your-iobridge/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 13:52:39 +0000</pubDate>
		<dc:creator>Marc Fonteijn</dc:creator>
				<category><![CDATA[iobridge]]></category>

		<guid isPermaLink="false">http://www.marcathing.com/2009/06/21/controlling-the-sparkfuncom-serial-lcd-hd44780-using-your-iobridge/</guid>
		<description><![CDATA[In this previous post I demonstrated the a new API which makes it very easy to control your ioBridge. In this post I&#8217;m building upon that API to show how you can control a Serial LCD from sparkfun.com. You can buy a nice serial LCD directly from the ioBridge store at almost the same price [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.marcathing.com/2009/06/21/an-easy-api-for-the-iobrigde-to-use-with-ajax-php-java-phyton-etc/">this previous post</a> I demonstrated the a new API which makes it very easy to control your <a href="http://www.iobridge.com">ioBridge</a>. In this post I&#8217;m building upon that API to show how you can control a Serial LCD from sparkfun.com. You can buy a nice serial LCD directly from the <a href="http://iobridge.com/store/">ioBridge store</a> at almost the same price but the display is only available in 1 color (<a href="http://www.iobridge.net/wiki/function-boards/serial-lcd">white</a>) whereas sparkfun has more choice (<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=812">red</a>/<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=814">yellow</a>/<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=461">black</a>/<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=813">white</a>). The displays are almost identical as they both use the worlds most popular LCD, the <a href="http://en.wikipedia.org/wiki/HD44780_Character_LCD">HD44780</a>. The LCD from ioBridge has some nice off the shelf build in that the sparkfun LCD&#8217;s don&#8217;t have like the option to draw a gauge. But you should be able to mimic all those functions with some creative programming (as I&#8217;ve already done in the examples that follow below).</p>
<p>To make life easier I&#8217;ve build a small JavaScript library that provides simple functions to control your LCD and also a library that provides some very basic animation functions which you see in the video below.</p>
<p><object type="application/x-shockwave-flash" width="540" height="405" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=71ffdc3a00&#038;photo_id=3646922258"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=71ffdc3a00&#038;photo_id=3646922258" height="405" width="540"></embed></object></p>
<p><strong>Some things you should know before you get started</strong></p>
<ul>
<li>You can control the LCD using the <em>I/O Serial Out widget</em>, in this case you can use wire the LCD up to a <a href="http://www.iobridge.net/wiki/function-boards/terminal-board">Terminal Board</a> and plug it directly into an free channel on your ioBridge module.</li>
<li>You can also control the LCD using the <a href="http://www.iobridge.net/wiki/smart-boards/serial-smart-board">Serial Smart Board</a> (as shown in this example). In this case you need to create a <em>Send Serial Message (variable message) widget</em>. I&#8217;ve hooked a terminal board up to my serial smart board but in this case <span style="color: #f00">the wiring is different</span>! The input pins on the terminal board don&#8217;t match the output pins on the serial smart board. The 3 things you need to know are [AI -> +5v] / [DO -> RX] / [+5v -> GND].<br />
Don&#8217;t forget to set the channel mode to &#8220;serial&#8221; in your ioBridge dashboard.<br />
<a href="http://www.flickr.com/photos/marcfonteijn/3646788392/" title="Different wiring for the Serial Smart Board! by marcfonteijn, on Flickr"><img src="http://farm4.static.flickr.com/3647/3646788392_859f01de16.jpg" width="500" height="375" alt="Different wiring for the Serial Smart Board!" /></a></li>
<li>Have your <em>signal mode</em> set to <em>true</em>. If it&#8217;s set to inverted you&#8217;ll get gibberish on your display.
</ul>
<p><a href="http://www.flickr.com/photos/marcfonteijn/3647001832/" title="ioBridge | Modules by marcfonteijn, on Flickr"><img src="http://farm4.static.flickr.com/3643/3647001832_8c03121f42_o.jpg" width="557" height="289" alt="ioBridge | Modules" /></a></p>
<p><strong>How to use</strong><br />
Once you&#8217;ve setup the ioBridge proxy it&#8217;s a breeze to get the LCD demo working.<br />
1. Make sure you have the iobridge-proxy up and running (see this article)<br />
2. Download <a href="https://marcathing.com.s3.amazonaws.com/iobridge.js">iobridge.js</a>, <a href="https://marcathing.com.s3.amazonaws.com/serial-lcd.js">serial-lcd.js</a>, <a href="https://marcathing.com.s3.amazonaws.com/serial-lcd-anim.js">serial-lcd-anim.js</a> and <a href="https://marcathing.com.s3.amazonaws.com/lcd.html">lcd.html</a><br />
3. Open <em>iobridge.js</em> and set the <em>baseUrl</em> to you iobridge-proxy url.<br />
4. Open <em>serial-lcd.js</em> and set the <em>widgetID</em> to your widget that controls the LCD.<br />
<a href="http://www.flickr.com/photos/marcfonteijn/3644410305/" title="ioBridge | Widgets by marcfonteijn, on Flickr"><img src="http://farm4.static.flickr.com/3372/3644410305_573fabbb7a.jpg" width="500" height="274" alt="ioBridge | Widgets" /></a><br />
5. Upload all the files to your webserver<br />
6. Fire up a browser and go to http://yourserver.com/lcd.html and see if your LCD is working</p>
<p><strong>What&#8217;s next</strong><br />
* The animations are really basic, please help to extend this. If you&#8217;ve created some animation share them in the comments below.</p>
<p><strong>Bugs</strong><br />
* Because there is a rather big delay between requests send to the ioBridge module >0.5s it somewhat limits how smooth some animations work. It would be nice if we could send a &#8220;sleep&#8221; command to the ioBridge along with the string for the LCD. In that way you&#8217;d send 1 long command that includes sleeps instead of making separate calls to the ioBridge.<br />
* <del datetime="2009-06-21T18:06:16+00:00">Somehow programming the CGRAM with custom characters doesn&#8217;t work. If you have any clues why please leave a comment <a href="http://forum.sparkfun.com/viewtopic.php?p=75383">here</a>.</del> This issue is fixed with the help of the ioBridge team! See the example in the video below</p>
<p><object type="application/x-shockwave-flash" width="540" height="405" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=65cf6c3dd3&#038;photo_id=3647346121"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=65cf6c3dd3&#038;photo_id=3647346121" height="405" width="540"></embed></object></p>
<p><strong>Download files</strong><br />
* <a href="https://marcathing.com.s3.amazonaws.com/iobridge-serial-lcd-1.0.zip">iobridge-serial-lcd-1.0.zip</a> (all files)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcathing.com/2009/06/21/controlling-the-sparkfuncom-serial-lcd-hd44780-using-your-iobridge/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An easy API for the ioBrigde to use with Ajax/PHP/Java/Phyton/etc</title>
		<link>http://www.marcathing.com/2009/06/21/an-easy-api-for-the-iobrigde-to-use-with-ajax-php-java-phyton-etc/</link>
		<comments>http://www.marcathing.com/2009/06/21/an-easy-api-for-the-iobrigde-to-use-with-ajax-php-java-phyton-etc/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 13:42:21 +0000</pubDate>
		<dc:creator>Marc Fonteijn</dc:creator>
				<category><![CDATA[iobridge]]></category>

		<guid isPermaLink="false">http://www.marcathing.com/2009/06/21/an-easy-api-for-the-iobrigde-to-use-with-ajaxphpjavaphytonetc/</guid>
		<description><![CDATA[If you don&#8217;t know what an ioBridge is I suggest you first read this page. It&#8217;s basically enables you to hookup all kinds of physical stuff (sensors, readers, led&#8217;s, lcd&#8217;s, servo&#8217;s, motors, etc) and control them true the web with great ease. 

The people from ioBrigde have done a great job making it very easy [...]]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t know what an ioBridge is I suggest you first read <a href="http://iobridge.com/">this page</a>. It&#8217;s basically enables you to hookup all kinds of physical stuff (sensors, readers, led&#8217;s, lcd&#8217;s, servo&#8217;s, motors, etc) and control them true the web with great ease. </p>
<p><a href="http://www.flickr.com/photos/marcfonteijn/3645982769/" title="ioBridge &amp; SparkFun Serial LCD by marcfonteijn, on Flickr"><img src="http://farm4.static.flickr.com/3630/3645982769_07d378177f.jpg" width="500" height="375" alt="ioBridge &amp; SparkFun Serial LCD" /></a></p>
<p>The people from ioBrigde have done a great job making it very easy to get your first project up and running. Just hook the ioBrigde up to any internet connection, browse to you personal ioBridge control panel and create some widgets to control the input and output channel. I got my first project running in under 10 minutes without any prior knowledge about the system!</p>
<p>There are different ways to talk to your ioBridge module. One of the are the widgets on the iobrigde.com site but there are also <a href="http://www.iobridge.net/wiki/api">different API&#8217;s</a> available. Unfortunately it was pretty hard to access your module using regular http calls. You best shot was to make use of the <a href="http://www.iobridge.net/wiki/api/javascript-widget-control-api">JavaScript Widget Control API</a> but this isn&#8217;t a very flexible API as it forces html code onto your page and is useless if you want to make http calls from Java/PHP/Phyton/etc.</p>
<p>Another problem with the available ioBridge API&#8217;s is that they are slow. If you for instance want to make a background call to your ioBrigde when someone opens your website to blink a light you don&#8217;t want the visitor of your website to wait for 2 seconds before the ioBridge module returns a response. The event should be triggered without the user hardly noticing any delay. The way to make background calls on the web is of course by using Ajax. This brings another challenge along. As the ioBridge is located at iobridge.com every request goes to that domain. And as we all know you can&#8217;t make cross-domain Ajax calls.</p>
<p><strong>So the ioBridge that has 3 issues</strong><br />
1. No easy API to control the module from anything else then a webpage<br />
2. The module isn&#8217;t very fast and can become a bottleneck<br />
3. Can&#8217;t make Ajax calls as the module is located at iobridge.com </p>
<p>The code that you&#8217;ll find below fixes all these things!</p>
<p>My solution to this was to create an ioBridge Proxy that resides on you local server, parses your requests and forwards them to your module. To this I added a new JavaScript API that utilizes this proxy and by default makes it&#8217;s call using Ajax.</p>
<p><strong>How to use this?</strong><br />
Follow these very simple steps to use this new ioBridge API.<br />
1. Download <a href="https://marcathing.com.s3.amazonaws.com/iobridge-proxy.php">iobridge-proxy.php</a> to your computer<br />
2. Upload iobridge-proxy.php to your webserver (requires PHP >5)<br />
3. Now create a widget using your iobridge.com portal. One that activates a lights or reads an analog value are probably the best to test.<br />
4. Next up copy the widgetID (not the actionID!) and open the url in your browser, this should look something like <em>http://yourdomain.com/iobridge-proxy.php?widgetID=xxxxxxxxxxxx</em>.<br />
<a href="http://www.flickr.com/photos/marcfonteijn/3644410305/" title="ioBridge | Widgets by marcfonteijn, on Flickr"><img src="http://farm4.static.flickr.com/3372/3644410305_573fabbb7a.jpg" width="500" height="274" alt="ioBridge | Widgets" /></a><br />
5. If you just want to make http calls from lets say PHP then you&#8217;re done! </p>
<p>The next steps are useful if you want to use the Ajax API.<br />
6. Download <a href="https://marcathing.com.s3.amazonaws.com/iobridge.js">iobridge.js</a> and <a href="https://marcathing.com.s3.amazonaws.com/example.html">example.html</a><br />
7. Open iobridge.js and change the baseUrl variable so that it matches your domain and directory structure<br />
8. Open example.html and change the widgetID&#8217;s.<br />
* <em>execute</em> should be an <em>Digital Output Pulse</em> widget<br />
* <em>getValue</em> should be an <em>I/O Monitor</em> widget<br />
* <em>setState(on)</em> and <em>setState(off)</em> should be an <em>Digital Output Control</em> widget<br />
* <em>setValue</em> should be an <em>Serial Out</em> or <em>Send Serial Message</em> widget<br />
9. Upload iobridge.js and example.html to the same server as your iobridge-proxy.php<br />
10. Open http://yourserver.com/example.html and test the functions<br />
The current example uses JQuery to make the Ajax calls but of course you can change this to anything you like.</p>
<p>That&#8217;s it, with these 3 files you&#8217;ve freed your ioBridge from the constraints of the current API&#8217;s. It&#8217;s should now be a lot easier to use the ioBridge in any of your mashup projects!</p>
<p><strong>update</strong><br />
See <a href="http://www.marcathing.com/2009/06/24/pure-html-iobridge-proxy-example-no-javascript-at-all/">this article</a> if you&#8217;re looking for an example that doesn&#8217;t use any javascript to control the module.</p>
<p><strong>Download files</strong><br />
* <a href="https://marcathing.com.s3.amazonaws.com/iobridge-1.0.zip">iobridge-1.0.zip</a> (all required files)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcathing.com/2009/06/21/an-easy-api-for-the-iobrigde-to-use-with-ajax-php-java-phyton-etc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
