<?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>Hotsolder &#187; programming</title>
	<atom:link href="http://www.hotsolder.com/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hotsolder.com</link>
	<description>Electronics and other geeky pursuits!</description>
	<lastBuildDate>Sat, 31 Jul 2010 04:10:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GP3 Board on Sale (great for robotics and more)</title>
		<link>http://www.hotsolder.com/2008/01/gp3-board-on-sale-great-for-robotics-and-more.html</link>
		<comments>http://www.hotsolder.com/2008/01/gp3-board-on-sale-great-for-robotics-and-more.html#comments</comments>
		<pubDate>Sat, 19 Jan 2008 12:49:13 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/?p=143</guid>
		<description><![CDATA[
The GP-3 is a powerful board that you can use with or without a PC to do many physical computing tasks. I&#8217;ve talked about this board several times in this blog including this robot and this Visual Basic tutorial.
The boards are currently on sale. This is a great chance to pick up one or more [...]]]></description>
			<content:encoded><![CDATA[<p><a title="GP3" href="http://www.hotsolder.com/wp-content/uploads/2008/02/gp3.jpg"><img src="http://www.hotsolder.com/wp-content/uploads/2008/02/gp3.jpg" alt="GP3" width="320" height="240" align="left" /></a></p>
<p>The GP-3 is a powerful board that you can use with or without a PC to do many physical computing tasks. I&#8217;ve talked about this board several times in this blog including <a title="Easy Robot" href="http://www.hotsolder.com/2008/02/an-easy-robot.html" class="broken_link" >this robot</a> and this <a href="http://www.hotsolder.com/2007/12/real-word-control-with-visual-basic-express-2008.html" class="broken_link" >Visual Basic tutorial</a>.</p>
<p>The boards are currently <a href="http://www.awce.com/gp3.htm">on sale</a>. This is a great chance to pick up one or more for your next project.</p>
<p>The original purpose for this board was to act as an I/O device for a host computer (typically a PC). An efficient serial protocol (you can use a USB adapter) allows you to read analog voltages (5 channels of 10 bit A/D), output PWM, create and read pulses accurately, and control 8 bits of digital I/O. Library support is available for nearly any language. There are ActiveX and DLL libraries that you can use from C#, C++, Visual Basic, and many other Windows languages (for example, there&#8217;s a demo that uses the board with Microsoft Excel). There&#8217;s also a generic C library that works with Linux and most other platforms too.</p>
<p>With the free <a href="http://www.awce.com/gp3ez">GP3EZ </a>software, you can do many tasks (like the robot example above) using no programming at all. Better still once you have a script built using GP3EZ&#8217;s easy-to-use interface, you can &#8220;compile&#8221; the script down to the board and it will run without the PC until you reprogram it. In fact, things like timing become more accurate after you compile since the PC is notoriously bad at keeping time on small scales.</p>
<p>These boards aren&#8217;t on sale often, so pick one up while they are. Once you have simple I/O on your PC, you&#8217;d be surprised how handy it is. And since the GP3EZ scripts can run without a PC, using just one somewhere to replace a PC in a control application will save a bundle.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2008/01/gp3-board-on-sale-great-for-robotics-and-more.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it Basic or is it C? Its SEABASS</title>
		<link>http://www.hotsolder.com/2008/01/is-it-basic-or-is-it-c-its-seabass.html</link>
		<comments>http://www.hotsolder.com/2008/01/is-it-basic-or-is-it-c-its-seabass.html#comments</comments>
		<pubDate>Sat, 19 Jan 2008 02:53:00 +0000</pubDate>
		<dc:creator>wd5gnr</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hotsolder.com/blog/2008/02/18/is-it-basic-or-is-it-c-its-seabass/</guid>
		<description><![CDATA[Personally, I like to program in C. Luckily, there is pretty good C language support for most modern microprocessors. However, if you don&#8217;t know C, its a pretty steep learning curve. Sometimes you just want to bang something out quick.
If your processor wants you to use C but you want to use Basic, you might [...]]]></description>
			<content:encoded><![CDATA[<p>Personally, I like to program in C. Luckily, there is pretty good C language support for most modern microprocessors. However, if you don&#8217;t know C, its a pretty steep learning curve. Sometimes you just want to bang something out quick.</p>
<p>If your processor wants you to use C but you want to use Basic, you might try <a href="http://www.awce.com/seabassapp.htm">Seabass</a>. Seabass is a BASIC compiler that outputs C code. So anywhere you can compile a C program (even on Linux or Windows) you can write BASIC programs. Even better, Seabass integrates with existing C libraries and you can even embed C code in your program.</p>
<p>The link shows an entire article about using Seabass to produce some Morse code on an Atmel AVR and a PIC. Here&#8217;s the first part of the AVR program:</p>
<pre>include "avrio.bh"       ` get I/O routines</pre>
<pre>cinclude "app4delay.h"   ` get delay routines (from C)</pre>
<pre>#link "app4delay.c"      ` include C library</pre>
<p><!--mstheme--><span style="font-family: arial,helvetica"><!--mstheme--></span></p>
<pre>` Define a string typedef</pre>
<pre>type string char *</pre>
<p><!--mstheme--><span style="font-family: arial,helvetica"><!--mstheme--></span></p>
<pre>` Speed of a dot in milliseconds</pre>
<pre>Const speed=200</pre>
<p><!--mstheme--><span style="font-family: arial,helvetica"></p>
<p align="left">The first line includes a basic header file (by convention,  these files have a .bh extension). This is a SeaBass file (included on the CDROM)  that provides some common I/O routines for the APP-IV (the target board). This line allows us to  use things like HIGH and LOW to affect the I/O pins.</p>
<p align="left">The second line includes a C file, not a SeaBass file. This file  is one that the APP-IV kit supplies and provides an easy way to write delays.  Notice the line just under this tells the compiler where to find the associated  C file. If you are manually compiling SeaBass&#8217; output, this isn&#8217;t necessary, but  if SeaBass controls the build process, this will allow it to automatically bring  in the correct C code that your program needs.</p>
<p align="left">Type names in SeaBass have to be a single word. However, many C  types use multiple words (or even symbols). For example, if you want to deal  with a string, in C you use a character pointer represented by &#8220;char *&#8221;. The  SeaBass DefType statement allows you to make a SeaBass type that represents a  complex C type:</p>
<p> <!--mstheme--></p>
<p></span></p>
<pre>` Define a string typedef</pre>
<pre>type string char *</pre>
<p><!--mstheme--><span style="font-family: arial,helvetica"></p>
<p align="left">The final part of the initial part of the program sets a  constant using Const. In this case, the speed value is set to 200 (this will be  the number of milliseconds to delay for a dot).</p>
<p align="left">Now it is very simple to understand the main code:</p>
<p> <!--mstheme--></p>
<p></span></p>
<pre>` Main program</pre>
<pre>function main() as int</pre>
<pre>dim text as string</pre>
<pre>dim i</pre>
<pre>text="-.-. --.-"   ` message to send</pre>
<pre>` Set LED to output</pre>
<pre>OUTPUT(B,0)</pre>
<p><span style="font-family: arial,helvetica"></p>
<p align="left">The first two lines in the function define variables (notice one  of them is a string).</p>
<p align="left">Here&#8217;s the main loop:</p>
<p> <!--mstheme--></p>
<p></span></p>
<pre>` Main code</pre>
<pre>top: for i=0 to strlen(text)-1</pre>
<pre>` walk through text</pre>
<pre>     if text[i]='.' then</pre>
<pre>	dot()</pre>
<pre>     end if</pre>
<pre>     if text[i]='-' then</pre>
<pre>	dash()</pre>
<pre>     end if</pre>
<pre>    if text[i]=' ' then</pre>
<pre>      space()</pre>
<pre>    end if</pre>
<pre> next</pre>
<p><!--mstheme--><span style="font-family: arial,helvetica"></p>
<p align="left">Notice that the program uses the C library call strlen to find  the length of the string. Of course, you could write a version of strlen in  SeaBass, but since the C compiler already has this function, why not use it?</p>
<p>You can read the <a href="http://www.awce.com/seabassapp.htm">whole article</a> or look at an example <a href="http://www.awce.com/seabasslcd.htm">with an LCD library</a>. You can also play with a demo of <a href="http://www.awce.com/sbdemo.htm">Seabass online</a>.</p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hotsolder.com/2008/01/is-it-basic-or-is-it-c-its-seabass.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
