<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-25773908</id><updated>2011-04-21T10:49:07.812-07:00</updated><title type='text'>EXTREME Physical Computing ADVENTURES</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-25773908.post-114867538589538617</id><published>2006-05-26T13:23:00.000-07:00</published><updated>2006-05-26T13:29:46.003-07:00</updated><title type='text'>In the end :(</title><content type='html'>After lots of work in flash and nothing really to show for it , I am stuck at getting my computer to recognize my button presses.  The hyperterminal in XP will printout a different character for each button being pressed.  Here is the code I got to do this:&lt;br /&gt;&lt;br /&gt;Public Const RedUp as Byte = 9&lt;br /&gt;Public Const RedRight as Byte = 10&lt;br /&gt;Public Const RedDown as Byte = 11&lt;br /&gt;Public Const RedLeft as Byte = 12&lt;br /&gt;Public Const BlackLeft as Byte = 13&lt;br /&gt;Public Const BlackDown as Byte = 14&lt;br /&gt;Public Const BlackRight as Byte = 15&lt;br /&gt;Public Const BlackUp as Byte = 16&lt;br /&gt;Public Const startGame as Byte = 17&lt;br /&gt;Public Const selectGame as Byte = 18&lt;br /&gt;&lt;br /&gt;Option Explicit&lt;br /&gt;&lt;br /&gt;Public Sub Main()&lt;br /&gt;&lt;br /&gt;Dim button as byte&lt;br /&gt;Dim outQ(1 to 40) as byte&lt;br /&gt;Dim inQ(1 to 10) as byte&lt;br /&gt;Dim outString as string&lt;br /&gt;Dim state as boolean&lt;br /&gt;Dim asciiNum as byte&lt;br /&gt;&lt;br /&gt; call openqueue(inQ, 10)&lt;br /&gt; call openqueue(outQ, 40)&lt;br /&gt; call definecom3(8, 7, bx1000_1000)&lt;br /&gt; call opencom(3, 9600, inQ, outQ)&lt;br /&gt; do&lt;br /&gt;  for button =9 to 18&lt;br /&gt;   state = getpinvalue(button)&lt;br /&gt;   if state = true then&lt;br /&gt;    if(button = 9) then&lt;br /&gt;     asciiNum = 97&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 10) then&lt;br /&gt;     asciiNum = 98&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 11) then&lt;br /&gt;     asciiNum = 99&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 12) then&lt;br /&gt;     asciiNum = 100&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 13) then&lt;br /&gt;     asciiNum = 65&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 14) then&lt;br /&gt;     asciiNum = 66&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 15) then&lt;br /&gt;     asciiNum = 67&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 16) then&lt;br /&gt;     asciiNum = 68&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 17) then&lt;br /&gt;     asciiNum = 83&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;    if(button = 18) then&lt;br /&gt;     asciiNum = 115&lt;br /&gt;     call putqueue(outQ, asciiNum , 1)&lt;br /&gt;    end if&lt;br /&gt;   end if&lt;br /&gt;  next&lt;br /&gt;' delay 0.2&lt;br /&gt; loop&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Public Function GetPinValue(ByVal button as Byte) as Boolean&lt;br /&gt;&lt;br /&gt; if(GetPin(button)=0) Then&lt;br /&gt;  getpinvalue = false&lt;br /&gt; else&lt;br /&gt;  getpinvalue = true&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt;end function&lt;br /&gt;&lt;br /&gt;I wish I could have made a custom DDR emulator, but I tried and its just way too difficult for me .  I had a great time doing this project, even though it was so challenging.  In general I had a great time (even though stressful sometimes) in this class.  I know I learned a great deal and even considering getting more into this type of thing to make cool stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114867538589538617?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114867538589538617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114867538589538617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114867538589538617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114867538589538617'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/in-end.html' title='In the end :('/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114867494707947744</id><published>2006-05-26T13:06:00.000-07:00</published><updated>2006-05-26T13:22:49.470-07:00</updated><title type='text'>New project idea!</title><content type='html'>5-19-06:&lt;br /&gt;&lt;br /&gt;I have decided to shift tack a little bit and change my final project idea.  I am now going to make a hand sized ddr controller for the computer.  But there's an added extra, the arrow pads are close enough together so that the two players will physically have to battle each other. I guess one could call it Finger Battle Dance Dance Revolution.  To do this I will need to added 8 buttons (4 for each player's arrow) and then at least two extras for start and select funtionality.  I went to Radioshack and bought 12 SPST Momentary switches and a project box.  I started buy attaching leads to all my switches with plenty of wire room.  I then ran the leads from each switch from the power line of bread board to a different port in the different input to the multiplexer.  To complete the circuits, I ran 100 ohm resistors from each port to the ground line.  I then added a bit to my code to just check and see if it would work: it just prints a 1 if the switch is on or 0 if its off. It ran ok it seemed, but it was laggy thanks to the loop running to cycle the multiplexer.  I took the multiplexer out alltogether and then ran the leads of the switches instead to the bx-24 directly.  I added this code to get it to print ones when buttons are pressed.&lt;br /&gt;&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Option Explicit&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Public Sub Main()&lt;br /&gt;&lt;br /&gt;    Dim State As Boolean&lt;br /&gt;    Dim Address As Byte&lt;br /&gt;&lt;br /&gt;    Debug.Print&lt;br /&gt;    Debug.Print "Demo of DDR Finger Pad"&lt;br /&gt;    Debug.Print&lt;br /&gt;&lt;br /&gt;    Do&lt;br /&gt;        For Address = 9 To 16&lt;br /&gt;&lt;br /&gt;            State = GetPinValue(Address)&lt;br /&gt;&lt;br /&gt;            If (State = True) Then&lt;br /&gt;                Debug.Print "1 ";&lt;br /&gt;            Else&lt;br /&gt;                Debug.Print "0 ";&lt;br /&gt;            End If&lt;br /&gt;        Next&lt;br /&gt;&lt;br /&gt;        ' Add &lt;CR&gt;&lt;LF&gt;&lt;br /&gt;        Debug.Print&lt;br /&gt;&lt;br /&gt;        Delay 0.2&lt;br /&gt;    Loop&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Public Function GetPinValue( _&lt;br /&gt; ByVal Address As Byte) As Boolean&lt;br /&gt;&lt;br /&gt;    If (GetPin(Address) = 0) Then&lt;br /&gt;        GetPinValue = False&lt;br /&gt;    Else&lt;br /&gt;        GetPinValue = True&lt;br /&gt;    End If&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;It started working right it seemed, but four of my switches are always inverted.  This is because I got some always open and some always closed switches.   And also I realize that I am going to need two ports free for the serial communication.   I am just going to unplug the four wrong switches for now to save time.  Now all I have to do is get the switch presses into computer somehow.  The best way would be to write a serial driver so one could use any dance dance revolution  emulator.  But I do not really know how to do that .  I will research a bit and come up with something.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114867494707947744?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114867494707947744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114867494707947744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114867494707947744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114867494707947744'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/new-project-idea.html' title='New project idea!'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114855336906384101</id><published>2006-05-25T03:18:00.000-07:00</published><updated>2006-05-25T04:25:12.770-07:00</updated><title type='text'>Experimenting with Multiplexers</title><content type='html'>5-20-06:&lt;br /&gt;&lt;br /&gt;I have not had much luck in finding equipment for either of the projects that I would like to do, I do not have the time to order online and apparently local stores are just lame.  On the other hand, one of my Electrical Engineering friends had an extra multiplexer just lying around so I was really curious to start using one of those.  I read the documents he prined off of Texas Instruments tech support site and it seemed simple enough, but after a little bit of playing around I realized that this chip wasnt going to do exacltly what I thought it would.  I thought that the multiplexer would magically take a bunch if inputs and compress them all down to one.  What it actually does is take a group of inputs and then drops thme ONE AT A TIME in another location.  You get to choose what input is being selected whenever, however that means the device itself actually takes 4 inputs (and generates 8 , making it not as amazing as it seems).   Here is the code I used as some sample work:&lt;br /&gt;&lt;br /&gt;Public Sub Main()&lt;br /&gt;&lt;br /&gt;    Dim State As Boolean&lt;br /&gt;    Dim Address As Byte&lt;br /&gt;&lt;br /&gt;    Debug.Print&lt;br /&gt;    Debug.Print "Demo of 74HCT251 Input Multiplexer"&lt;br /&gt;    Debug.Print&lt;br /&gt;&lt;br /&gt;    Call InitializeIMux&lt;br /&gt;&lt;br /&gt;    Do&lt;br /&gt;        For Address = 0 To 7&lt;br /&gt;&lt;br /&gt;            State = GetPinIMux(Address)&lt;br /&gt;&lt;br /&gt;            If (State = True) Then&lt;br /&gt;                Debug.Print "1 ";&lt;br /&gt;            Else&lt;br /&gt;                Debug.Print "0 ";&lt;br /&gt;            End If&lt;br /&gt;        Next&lt;br /&gt;&lt;br /&gt;        ' Add &lt;CR&gt;&lt;LF&gt;&lt;br /&gt;        Debug.Print&lt;br /&gt;&lt;br /&gt;        Delay 0.5&lt;br /&gt;    Loop&lt;br /&gt;&lt;br /&gt;End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114855336906384101?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114855336906384101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114855336906384101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114855336906384101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114855336906384101'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/experimenting-with-multiplexers.html' title='Experimenting with Multiplexers'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114855220473749373</id><published>2006-05-25T03:14:00.000-07:00</published><updated>2006-05-25T04:18:21.340-07:00</updated><title type='text'>Another idea for a final project!</title><content type='html'>5-17-06:&lt;br /&gt;&lt;br /&gt;ctqxsI actually have to thank Professor Jacobs for his inspiration behind this idea.  I had rode my skateboard to class and was asked if that was a part of my project.  I of course immediately responded yes without even thinking, but then I started to wonder if there was anything I could do with a skateboard.  It occured to me that I could fabricate a fairly simple controller for a computer that would allow for more realistic board games.  For this project I would need some accelerometers or tilt-sensors of some sort.  Ultimately that seems much more achievable than the monome project, even if the monome is way cooler.  I have no idea where I could find the sensors I would need though, so I will be on the lookout for those.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114855220473749373?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114855220473749373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114855220473749373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114855220473749373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114855220473749373'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/another-idea-for-final-project.html' title='Another idea for a final project!'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114855128193299695</id><published>2006-05-25T02:53:00.000-07:00</published><updated>2006-05-25T03:17:40.026-07:00</updated><title type='text'>Nearing the end :(</title><content type='html'>5-16-06:&lt;br /&gt;&lt;br /&gt;We were just recently informed of the requirements for the last project of Physical Computing:  to implement Serial communication.  The first thing that I thought of was to replicate a really cool device I saw @ monome.org.  It is an audio mixer of sorts with a ton of buttons for maximum creativity.  I figured that the easiest way to handle that many inputs would be to use a system of multiplexers.  However, I have never had to use these before and have no idea how difficult it could be.  I am going to go check out a few electrionic stores to see how feasible the monome rip-off would be.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114855128193299695?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114855128193299695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114855128193299695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114855128193299695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114855128193299695'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/nearing-end.html' title='Nearing the end :('/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114766634071524457</id><published>2006-05-14T21:09:00.000-07:00</published><updated>2006-05-14T21:53:02.066-07:00</updated><title type='text'>Slow Progress</title><content type='html'>5-14-06:&lt;br /&gt;&lt;br /&gt;It never ceases to amaze me how much tougher Project 2 is than Project 1.  One would think that adding a motor to the mix was no big deal, but it really is.  Between adding capacitors, diodes, and transistors, theres a lot more places for anyone to mess up.  And apparently thats what I did.  I modeled my circuit on the previous motors I had been using to play with motors, which I had originally modeled after the book and website.  While I had success using the equipment provided by school earlier, when I tried on my alarm clock, the motors wouldn't spin.  I had to run through the circuit pulling diiferent parts (if possible) to see where the error may lie.  The capacitors I had seemed to be of the wrong caliber (I was running to much current through them) so I think that was causing them to just interpt the circuit.  I decided to run my motors on a dedicated line and not use capactiors as it shouldn't be too detrimental to anything.    Still the code would run but yet the motors wouldn't turn.  Then I noticed that my diodes were not the same part number as the ones we had been using in class.  While similiar in appearance, they were not suited for the cureent I was running.  In the end I came up with a fairly simple working solution for each motor. I ran a lead from the BX-24 to a transistor base input, I ran a lead from the emmitor of the transistor to the motor, and I ran a positive lead from the battery to the collector of the transistor making sure to properly ground the motor battery line with the BX-24 ground line.  This allowed the motor to spin when the pin was called from code.  I made a quick test pattern and put the clock on the ground and turned it on to just see if it would move.  THe motors tried to spin but the car ultimately would not move even on the most friction free of  surfaces.  THe motors did not have enough torque.  I realized I needed to come up with a whole other propulsion system for the unit.  I quickly cut the tape that held my breadboard to the lego motor assembly.  I turned to the little remote controlled car I had bought as another idea that I had early.  I was going to use the circuit board in the car for it's H-bridge, but it was too hard to located.  But I realized that as long as I could call a motor from my chip I could use any motor I wanted. I removed the solder binding the motors to the circuit board in the car and ran leads to the transitor emmitor as I had earlier ran the motors.  THe only difference with this setup is that one channel represents the front turning wheels and the other channel controls the rear drive wheels.  The major drawback of not finding the H-Bridge is that I do not have reverse control, meaning that I can only turn the wheels in one direction for the front and one way for the back (aka right or left and forward or reverse).  I actually thought of a way to regain full movement control, involving a double pole double throw relay, but I did not have the parts on hand.  I figured that through my code I could control the clock so that it would never need to reverse or turn two ways.  The plan was to have the unit sit and wait in the center of a room.  When it is time for the clock to wake the user, it would start rolling in ever-widening circles until it hits a wall and sounds the alarm (recognizing the contact via the front touch sensor).  At this point the alarm would hyper turn and propel forward in order to situate the car in such a way that it can get free from whatever obstacle is blocking its path.  It would continue to careen around the room hitting walls and setting the buzzer off.  This is a solid conecept but I could not get my code to do what I wanted in time.  Instead my car would roll in bigger circles, but the buzzer wouldn't sound and the escape routine wouldn't run.  Overall my project still has great potential to work, it just needs some better programming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114766634071524457?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114766634071524457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114766634071524457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114766634071524457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114766634071524457'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/slow-progress.html' title='Slow Progress'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114755069362856394</id><published>2006-05-13T12:59:00.000-07:00</published><updated>2006-05-14T21:14:13.866-07:00</updated><title type='text'>Just keep swimming</title><content type='html'>5-6-06:&lt;br /&gt;&lt;br /&gt;I am happy to say i am sitting here finally working on my restored laptop.  Unfortunately I will not be able to say more than that because I have a film shoot today that will take up most of my time, so now I have to finish my project tomorow.  I wish I could reschedule but my actors said this is the only time they have so I have no choice  I just hope my shoot runs smoothly and that carries over to this project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114755069362856394?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114755069362856394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114755069362856394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114755069362856394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114755069362856394'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/just-keep-swimming.html' title='Just keep swimming'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114746720630216053</id><published>2006-05-12T13:38:00.000-07:00</published><updated>2006-05-13T12:02:21.283-07:00</updated><title type='text'>Lucky Day</title><content type='html'>5-5-06L:&lt;br /&gt;&lt;br /&gt;I just got news in class that we have until Wednesday to finish our second project, and let me tell you what a godsend that is.  On a side note, we saw some really cool stuff today in class from a guest lecturer, Stephan (cant remember last name).  He takes devices he builds and makes art out of them.  The coolest was the baby bottle robots that play different sounds when tipped.  I think its awesome how this guy has created his own job field, and it seems like he is pretty good at what he does.  Also he was a good resource for knowledge: I explained what I was doin with my project and he gave me some recomendations on how to get it to work (he says an H-bridge would be the fastest, simplest, cheapest way to do my motors).  I am going to have to redo a bit of my project based on what he was saying.   Anyways, I have good news and bad news.  The good news is that my chip still works and is able to get code downloaded to it.  The bad news is that when I tried to download to the other chip it wouldn't work (just flashes the green LED repeatedly), I wasted a lot of time trying to fix something that wasn't broken and my roomates computer serial port must be bad.  Luckily more parts are coming for my laptop this afternoon so I should be back in business on my own machine, which I can tell you I am looking forward to immensely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114746720630216053?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114746720630216053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114746720630216053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114746720630216053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114746720630216053'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/lucky-day.html' title='Lucky Day'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114740199365581890</id><published>2006-05-11T19:46:00.000-07:00</published><updated>2006-05-13T12:56:15.016-07:00</updated><title type='text'>It could always be worse</title><content type='html'>5-11-06:&lt;br /&gt;&lt;br /&gt;After working through the night into the morning I have to say that this project was a lot tougher than I thought.  After my computer died I ended up switching to my old AMD K7 computer thinking it would at least code in Basic decently.  However my efforts were thwarted when it took 2 minutes to browse to the basicx site and was going to take 30 mins to download the installer file.  Luckily my roomate was willing to give up his computer for the night and I started trying to work on there.  I hooked up my chip with serial and tried to load some code.  It loads the code then says there is a eeprom verification error.  Every time I try to load code it fails to download it.  There is a program running on the chip: it displays the time.  I switch my BX-24 with the spare one I had.  This one fails to communicate as well but just in general, I have no idea why.  I spent the next hour resoldering my cable, trying different cable - pin combinations just trying to get that thing working.  After making no progress in getting either BX-24 to communicate with the computer and I am actually beginning to believe that there may be something wrong with computer.  Unfortunately, there is no other machine that I can use so I am effectively stuck at this point.  I typed out a bunch of pwm code that I was hoping would run both of my motors simultaneously using Timer1 but without being able to even test it, I have no idea if its going to do anything.  I am goign to grab a little sleep before class when I am going to beg for an extension.  &lt;br /&gt;&lt;br /&gt;PS - After I got home from class I found that my roomate had taken his computer back  and now I can't find my code that I was working on.  I am not going to rewrite it because I think I am going to take a different approach hardware wise and that will probably change how I want to code this out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114740199365581890?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114740199365581890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114740199365581890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114740199365581890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114740199365581890'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/it-could-always-be-worse.html' title='It could always be worse'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114728382789748496</id><published>2006-05-10T10:56:00.000-07:00</published><updated>2006-05-10T10:57:08.416-07:00</updated><title type='text'>An absolute nightmare...</title><content type='html'>5-7-06:&lt;br /&gt;&lt;br /&gt;I have to think this is the most frustrated that I have ever been on any project ever.  I have gotten caught up and helhback at almost every step of the way.  So I got a new motherboard and video card for my computer and installed them.  Everything is working fine, great!  I start working on getting code onto my BX-24, but then I get an error connecting:(  I try reseating my wires and checking for shorts, but I dont see anything.  Still no go so I figure that there must be something wrong with my cable.  I spliced new leads onto the serial cable and still the same problem.  Wierd.  Next I decided to try out my BX-24 instead of the spare (borrowed from class) which I was currently running.  Still no dice.  I decided to check my cable again, and after a little more testing, I realized that I had mixed up some colors when soldering my cable and that one of the pins was not attached.  I fixed the error there and then I was able to download a sample bit of code.  Everything is back on track now. YAY!  I got some code worked out for some basic functionality just to test out my hardware but not thirty minutes later there is a click and my computer screen goes blank.  When I reboot, I get the same dead screen, which tells me it is probably the video card.  Being Sunday there are no stores open late, I am going to have to borrow a computer rather than try to fix mine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114728382789748496?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114728382789748496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114728382789748496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114728382789748496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114728382789748496'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/absolute-nightmare.html' title='An absolute nightmare...'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114728213043961373</id><published>2006-05-10T10:28:00.000-07:00</published><updated>2006-05-10T10:42:23.513-07:00</updated><title type='text'>Trouble in the Message Center</title><content type='html'>5-5-06:&lt;br /&gt;&lt;br /&gt;Well I am hardly able to contain my anger for Dell any longer.  Having sent out parts to service my laptop twice now, my laptop is still not fixed.  This means I will just have to buy some new parts for my desktop to get it working for the project.  I am building my device chasis now, I constructed the full lego car that I had bought and then stripped it down to just the flat base to provide a flat surface to strap my breadboard onto.  With my chip and breadboard ready to go on the car body, I needed to add movement.  I couldnt get the wheels to work with the car originally, the body prevented the wheels from contacting the ground, so the easiest fix was to just flip the car body over so the wheels were closer (which worked just fine).  For the front, I created a gliding tool that would let the car move omni-directionally by the power provided from the rear wheels (whichever way they happen to be turning).  To attach wheels to the motor, I drilled a hole through one of the lego "gear sticks" and then mounted the wheel on the custome cog I made.  To avoid wall collisions and obstacles I mounted a touch sensor in the front with a long extension for easy triggering.  With all my current hardware mounted I wanted to start running the code to get my device functioning, but I do not have a working computer.  I am going to go to get some computer parts to get my code done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114728213043961373?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114728213043961373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114728213043961373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114728213043961373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114728213043961373'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/trouble-in-message-center.html' title='Trouble in the Message Center'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114710178097915192</id><published>2006-05-08T08:12:00.000-07:00</published><updated>2006-05-10T08:15:38.880-07:00</updated><title type='text'>When all else fails, just spend. spend, spend!</title><content type='html'>5-3-06&lt;br /&gt;&lt;br /&gt;The other day when I went to the craft store, I had quite a time trying to decide what the best way to make my board mobile was.  I wanted something that wasn't too buly or heavy, but not too flimsy either.  I ended up just grabbing a lego car kit and plan on cannibalizing that for some parts.  I also went to radioshack and grabbed a slew of motor accesories including, two 3V DC motors, 2 transistors, some assorted capacitors, and another battery case.  Its not really too specific, I still have a lot of room to change things up and I am going to see if I get any good ideas while I work on this.  Right now I am playing arround with my board and the legos to see how they might come together.  I think the best plan is to put two motors (one on each side) and have some sort of pivoting system.  I am still worried about what to do about the clock part, an LCD that size will have a lot of wires I'm sure.  I am going to check out some options at a Goldcrest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114710178097915192?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114710178097915192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114710178097915192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114710178097915192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114710178097915192'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/when-all-else-fails-just-spend-spend.html' title='When all else fails, just spend. spend, spend!'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114710114275610088</id><published>2006-05-08T08:02:00.000-07:00</published><updated>2006-05-10T08:15:06.813-07:00</updated><title type='text'>Project 2 ( A New Hope)</title><content type='html'>4-28-06&lt;br /&gt;&lt;br /&gt;Sadly today is the day that my first project goes the way of the dinosaurs, demolished to make way for my next glorious fabrication.  This time we are to encorporate motors as well with our BX-24, and while I have a feeling it should be pretty simple to work out some basic motor stuff, if Iwant to get into anything more complex its going to get tricy. FOr instance, two motors at the same time will be tricking because the chip needs to use PWM.  I'm fairly decided about what I would like to do: I have heard about studys that say that if you get out of bed to turn off your alarm clock you are more likely to get up.  Keeping this in mind, I would like to make a robotic alarm clock that will relocate itself every few minutes in order to make waking up a new challenge every day.  It seems simple enough, probably two motors, possibly an LCD, and of course the trusty BX-24.  I am going to go to the craft store and see if there is anything I can use to make a base for my device.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114710114275610088?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114710114275610088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114710114275610088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114710114275610088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114710114275610088'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/05/project-2-new-hope.html' title='Project 2 ( A New Hope)'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114620755940469928</id><published>2006-04-27T23:07:00.000-07:00</published><updated>2006-04-27T23:59:19.426-07:00</updated><title type='text'>Completion!!!</title><content type='html'>4-23-06:&lt;br /&gt;&lt;br /&gt;Given a little more time to work on polishing my project, I decided to look at my code and see if I might be able to make things a little more interesting.  I decided that I wanted to add more light patterns as I only really had five in addition to the basic blinking operation.  As I looked at my code to start adding things, I made a realization that I was not fully utilizing the structure of the Basix-X's progamming language.  By writing more subroutines for all of my light patterns I would be able to reuse some of the recurring patterns.  For example to turn on all the lights at once I created a subroutine like so:&lt;br /&gt;&lt;br /&gt;Private Sub AllOn()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Then I would call that instead of calling each individual LED each time like so:&lt;br /&gt;&lt;br /&gt;Private Sub OptionOneThree()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Just by doing this somewhat minor revision to my original code, I was able to shrink the length of my code by 17%.  I then set about adding new patterns, but first I needed a way for users to select different options.  I knew that I could use multiple swithces on my switchbox to create as many as lots of different light patterns, but I didn't want to overwhelm the user so I decided to add a light pattern for every combination of two switches flipped. This gives my device a total of 15 light patterns.  Creating the rest was a simple matter of duplicating My prvious pattern calls (using the updated code I developed).  This went quickly and soon I had all my pattern slots filled and operating correcctly.  Here is a sample of my final code:&lt;br /&gt;&lt;br /&gt;Option Explicit&lt;br /&gt; Public Const Knob As Byte = 20&lt;br /&gt; Public Const TopGreen As Byte = 19&lt;br /&gt; Public Const BottomGreen As Byte = 18&lt;br /&gt; Public Const TopYellow As Byte = 17&lt;br /&gt; Public Const MiddleYellow As Byte = 16&lt;br /&gt; Public Const BottomYellow As Byte = 15&lt;br /&gt; Public Const TopRed As Byte = 14&lt;br /&gt; Public Const BottomRed As Byte = 13&lt;br /&gt; Public Const SwitchFive As Byte = 12&lt;br /&gt; Public Const SwitchFour As Byte = 11&lt;br /&gt; Public Const SwitchThree As Byte = 10&lt;br /&gt; Public Const SwitchTwo As Byte = 9&lt;br /&gt; Public Const SwitchOne As Byte = 8&lt;br /&gt; Public Const LEDon As Byte = 1&lt;br /&gt; Public Const LEDoff As Byte = 0&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Public Sub Main()&lt;br /&gt; Call PutPin( SwitchOne, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchTwo, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchThree, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchFour, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchFive, bxInputPullup)&lt;br /&gt; Dim NotSwitched As Integer&lt;br /&gt; Do&lt;br /&gt;  NotSwitched = CInt( GetPin( SwitchOne ) ) + CInt( GetPin( SwitchTwo ) ) + CInt( GetPin( SwitchThree ) ) + CInt( GetPin( SwitchFour ) ) + CInt( GetPin( SwitchFive ) )&lt;br /&gt;  if NotSwitched = 5 then&lt;br /&gt;   Call OptionNone()&lt;br /&gt;  end if &lt;br /&gt;  if NotSwitched = 4 then&lt;br /&gt;   if GetPin( SwitchOne ) = 0 then&lt;br /&gt;    Call OptionOne() &lt;br /&gt;   end if&lt;br /&gt;   if GetPin( SwitchTwo ) = 0 then&lt;br /&gt;    Call OptionTwo() &lt;br /&gt;   end if&lt;br /&gt;   if GetPin( SwitchThree ) = 0 then&lt;br /&gt;    Call OptionThree() &lt;br /&gt;   end if&lt;br /&gt;   if GetPin( SwitchFour ) = 0 then&lt;br /&gt;    Call OptionFour() &lt;br /&gt;   end if&lt;br /&gt;   if GetPin( SwitchFive ) = 0 then&lt;br /&gt;    Call OptionFive() &lt;br /&gt;   end if&lt;br /&gt;  end if&lt;br /&gt;  if NotSwitched = 3 then&lt;br /&gt;   if ( GetPin( SwitchOne ) = 0 ) And ( GetPin( SwitchTwo ) = 0 ) then&lt;br /&gt;    Call OptionOneTwo() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchTwo ) = 0 ) And ( GetPin( SwitchThree ) = 0 ) then &lt;br /&gt;    Call OptionTwoThree() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchThree ) = 0 ) And ( GetPin( SwitchFour ) = 0 ) then&lt;br /&gt;    Call OptionThreeFour() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchFour ) = 0 ) And ( GetPin( SwitchFive ) = 0 ) then&lt;br /&gt;    Call OptionFourFive() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchOne ) = 0 ) And ( GetPin( SwitchThree ) = 0 ) then&lt;br /&gt;    Call OptionOneThree() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchOne ) = 0 ) And ( GetPin( SwitchFour ) = 0 ) then&lt;br /&gt;    Call OptionOneFour() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchOne ) = 0 ) And ( GetPin( SwitchFive ) = 0 ) then&lt;br /&gt;    Call OptionOneFive() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchTwo ) = 0 ) And ( GetPin( SwitchFour ) = 0 ) then&lt;br /&gt;    Call OptionTwoFour() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchTwo ) = 0 ) And ( GetPin( SwitchFive ) = 0 ) then&lt;br /&gt;    Call OptionTwoFive() &lt;br /&gt;   end if&lt;br /&gt;   if ( GetPin( SwitchThree ) = 0 ) And ( GetPin( SwitchFive ) = 0 ) then&lt;br /&gt;    Call OptionThreeFive() &lt;br /&gt;   end if&lt;br /&gt;  end if&lt;br /&gt; Loop&lt;br /&gt;End Sub&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionNone()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call AllOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call AllOff()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt;End Sub&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionOne()&lt;br /&gt; Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt; if Interval &lt;= 146 then&lt;br /&gt;  Call TopGreenOn()&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 146 then&lt;br /&gt;  if Interval &lt;= 292 then&lt;br /&gt;   Call GreenOn()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 292 then&lt;br /&gt;  if Interval &lt;= 438 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDoff )&lt;br /&gt;   Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 438 then&lt;br /&gt;  if Interval &lt;= 585 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 585 then&lt;br /&gt;  if Interval &lt;= 731 then&lt;br /&gt;   Call RedOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 731 then&lt;br /&gt;  if Interval &lt;= 877 then&lt;br /&gt;   Call BottomRedOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 877 then&lt;br /&gt;  if Interval &lt;= 1023 then&lt;br /&gt;   Call AllOn()&lt;br /&gt;  end if&lt;br /&gt; end if  &lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionTwo()&lt;br /&gt; Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt; if Interval &lt;= 146 then&lt;br /&gt;  Call BottomRedOn()&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 146 then&lt;br /&gt;  if Interval &lt;= 292 then&lt;br /&gt;   Call RedOn()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 292 then&lt;br /&gt;  if Interval &lt;= 438 then&lt;br /&gt;   Call PutPin( TopGreen, LEDoff )&lt;br /&gt;   Call PutPin( BottomGreen, LEDoff )&lt;br /&gt;   Call PutPin( TopYellow, LEDoff )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDoff )&lt;br /&gt;   Call PutPin( BottomYellow, LEDon )&lt;br /&gt;   Call PutPin( TopRed, LEDon )&lt;br /&gt;   Call PutPin( BottomRed, LEDon )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 438 then&lt;br /&gt;  if Interval &lt;= 585 then&lt;br /&gt;   Call PutPin( TopGreen, LEDoff )&lt;br /&gt;   Call PutPin( BottomGreen, LEDoff )&lt;br /&gt;   Call PutPin( TopYellow, LEDoff )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDon )&lt;br /&gt;   Call PutPin( TopRed, LEDon )&lt;br /&gt;   Call PutPin( BottomRed, LEDon )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 585 then&lt;br /&gt;  if Interval &lt;= 731 then&lt;br /&gt;   Call GreenOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 731 then&lt;br /&gt;  if Interval &lt;= 877 then&lt;br /&gt;   Call TopGreenOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 877 then&lt;br /&gt;  if Interval &lt;= 1023 then&lt;br /&gt;   Call AllOn()&lt;br /&gt;  end if&lt;br /&gt; end if &lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionThree()&lt;br /&gt; Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt; if Interval &lt;= 146 then&lt;br /&gt;  Call MiddleYellowOn()&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 146 then&lt;br /&gt;  if Interval &lt;= 292 then&lt;br /&gt;   Call PutPin( TopGreen, LEDoff )&lt;br /&gt;   Call PutPin( BottomGreen, LEDoff )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 292 then&lt;br /&gt;  if Interval &lt;= 438 then&lt;br /&gt;   Call YellowOn()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 438 then&lt;br /&gt;  if Interval &lt;= 585 then&lt;br /&gt;   Call PutPin( TopGreen, LEDoff )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDon )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 585 then&lt;br /&gt;  if Interval &lt;= 731 then&lt;br /&gt;   Call EndsOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 731 then&lt;br /&gt;  if Interval &lt;= 877 then&lt;br /&gt;   Call BottomRedOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 877 then&lt;br /&gt;  if Interval &lt;= 1023 then&lt;br /&gt;   Call AllOn()&lt;br /&gt;  end if&lt;br /&gt; end if  &lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionFour()&lt;br /&gt; Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt; if Interval &lt;= 256 then&lt;br /&gt;  Call EndsOn()&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 256 then&lt;br /&gt;  if Interval &lt;= 512 then&lt;br /&gt;   Call YellowOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 512 then&lt;br /&gt;  if Interval &lt;= 767 then&lt;br /&gt;   Call MiddleYellowOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 767 then&lt;br /&gt;  if Interval &lt;= 1023 then&lt;br /&gt;   Call AllOn()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionFive()&lt;br /&gt; Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt; if Interval &lt;= 256 then&lt;br /&gt;  Call MiddleYellowOn()&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 256 then&lt;br /&gt;  if Interval &lt;= 512 then&lt;br /&gt;   Call YellowOn()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 512 then&lt;br /&gt;  if Interval &lt;= 767 then&lt;br /&gt;   Call EndsOff()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt; if Interval &gt; 767 then&lt;br /&gt;  if Interval &lt;= 1023 then&lt;br /&gt;   Call AllOn()&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionOneTwo()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer) &lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionTwoThree()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer)&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionThreeFour()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call OptionOneTwo()&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer)&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionFourFive()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call GreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call YellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call RedOn()&lt;br /&gt; Call Delay( Timer) &lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionOneThree()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer)&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionOneFour()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call OptionOneThree()&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionOneFive()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer)&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionTwoFour()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call OptionOneFive()&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionTwoFive()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn() &lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub OptionThreeFive()&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Dim Timer As Single&lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt; Timer = ( Interval / CSng( 500 ) ) + 0.05&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call MiddleYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopYellowOn() &lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call BottomRedOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt; Call TopGreenOn()&lt;br /&gt; Call Delay( Timer )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub AllOn()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub BottomRedOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub TopRedOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub BottomYellowOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub MiddleYellowOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub TopYellowOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub BottomGreenOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub TopGreenOn()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub EndsOn()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub RedOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub GreenOn()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub YellowOn()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub AllOff()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub EndsOff()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub RedOff()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDoff )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub GreenOff()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub YellowOff()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub BottomRedOff()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub TopGreenOff()&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub MiddleYellowOff()&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt;End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114620755940469928?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114620755940469928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114620755940469928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114620755940469928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114620755940469928'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/04/completion.html' title='Completion!!!'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114484096197718815</id><published>2006-04-12T04:22:00.000-07:00</published><updated>2006-04-12T06:06:59.873-07:00</updated><title type='text'>THE END IS NEAR!</title><content type='html'>So after another long sleepless night in Rochester, my project is completed.  Compared to the prototype two days ago, I must say I am pretty impressed, everything came together quite nicely.  I managed to get to Radioshack yesterday, so now I have an analog input to add (potentiometer), a buzzer and some of the correct resistors so my devices should function properly now. The first thing I did upon sitting down to my work bench was to tear all of my old LED's off and the resistor attached to all 4 of them.  I found some more LEDs in my bag-o-tricks in the process so I decided to add those to my pile and get to work.  I cut the short leads as well as one side of each resistor, then soldered the cut side of the 100 ohm resistor to the cut side of the LED.  I cleaned that up by cutting the other side of the resistor as well.  Next I yanked off the old assorted resistors I had used before on the switch and replaced these with 100 ohm resistors as well.  One thing I should mention is that for some reason, tonight I was able to be neat and manage to keep the clutter down.  Also I rearranged where some of the devices were plugged in to help organize more.  Having completed upgrading the originally installed components (and adding 3 LEDS), I ran the original system software to see what would happen.  The lights and switch that were installed before performed like before (which is good).  Next I wanted to hook up my potentiometer, but the pins that it came with did not make a solid connection with my board and I ended up breaking one of them off in my attempts to straighten them out.  I decided to wire this with some wire and after soldering the 3 lines on it, it was a simple matter of trial and error with my board and an LED to find which wires were what.  I made sure to plug this analog input into an analog input pin as the bx-24 has only one side that an handle these.  It wasn't too hard to install the buzzer, I simply plugged the positive wire into an I/O and the negative to ground:  couldn't be simpler.  &lt;br /&gt;&lt;br /&gt;The next part I knew was going to be much more difficult than the hardware setup, the software design.  At this point I had a bunch of components on my board, but nothing that would do anything with them.  I made sure to start off by giving anything I would have to resuse a Const variable name.  These were inputs, outputs, and a few variables.&lt;br /&gt;&lt;br /&gt; Public Const Knob As Byte = 20&lt;br /&gt; Public Const TopGreen As Byte = 19&lt;br /&gt; Public Const BottomGreen As Byte = 18&lt;br /&gt; Public Const TopYellow As Byte = 17&lt;br /&gt; Public Const MiddleYellow As Byte = 16&lt;br /&gt; Public Const BottomYellow As Byte = 15&lt;br /&gt; Public Const TopRed As Byte = 14&lt;br /&gt; Public Const BottomRed As Byte = 13&lt;br /&gt; Public Const SwitchFive As Byte = 12&lt;br /&gt; Public Const SwitchFour As Byte = 11&lt;br /&gt; Public Const SwitchThree As Byte = 10&lt;br /&gt; Public Const SwitchTwo As Byte = 9&lt;br /&gt; Public Const SwitchOne As Byte = 8&lt;br /&gt; Public Const Buzzer As Byte = 6&lt;br /&gt; Public Const LEDon As Byte = 1&lt;br /&gt; Public Const LEDoff As Byte = 0&lt;br /&gt;&lt;br /&gt;Then in the Main Sub I made sure to assign my switches as analog input switches.&lt;br /&gt;&lt;br /&gt; Call PutPin( SwitchOne, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchTwo, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchThree, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchFour, bxInputPullup)&lt;br /&gt; Call PutPin( SwitchFive, bxInputPullup)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is where I started to have to get creative. I decided that what I wanted to do was make a sort of metronome with the potentiometer as a know that will control the speeds and the lights and sounds would keep beat.  I decided that this idea was too simple but that I could incorporate different elements all into one.  I decided thus that I would like my project to boot into a metronome as a sort of loading screen that would let you know that it is functioning properly in its default state.  To make things interesting, I decided you would be able to control the speed of the blinking lights with the potentiometer.  Then from there, the use would flip a switch in the 5-switch box to load a different program.  These programs would be different types of flashing light patterns controlled through the potentiometer.  If the user flips more switches than just one at a time, it will yell at them using the buzzer.  True I could make it so that every switch combination offers a different light pattern, but I decided to start off easy.  &lt;br /&gt;&lt;br /&gt;First I wanted to get the LEDs doing something with the potentiometer.  I looked up the library for this chip and learned it is pretty straight forward.  I started just playing around and realized that different data types were going to make this rough, but I was wrong, type switching is easy enough, I just had to get the syntax down.  First things first, I needed to get input from the potentiometer&lt;br /&gt;&lt;br /&gt;        Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt;&lt;br /&gt;I put in a debug.print statement with Interval in and ran that basic thing in main, and sure enough the numbers rolling up the screen would change whenever the know was turned.  Now I needed to figure out what to do with this tool.  I thought that a controllable light up progress bar would be cool. I divided 1023 by 7 and got intervals of 146, so i knew my range for each light.  I made a series of seven if statements, the first would check for the first group by its max number (146) then every statement after would be defined by starting at the previous number then another if statement would check the next 146 values. And so on.  These groups would be responsible for turning on the lights, I decided to let one LED get turned on each group for this program.  Using PutPin I was able to call all my LEDS by name with LEDon or LEDoff and they would do just as told.  All of the switch options have similiar code, they just turn on different LEDs in different configurations.&lt;br /&gt;&lt;br /&gt;Private Sub OptionOne()&lt;br /&gt;&lt;br /&gt; Dim Interval As Integer &lt;br /&gt; Interval = GetADC(Knob)&lt;br /&gt;&lt;br /&gt; if Interval &lt;= 146 then&lt;br /&gt;  Call PutPin( TopGreen, LEDon )&lt;br /&gt;  Call PutPin( BottomGreen, LEDoff )&lt;br /&gt;  Call PutPin( TopYellow, LEDoff )&lt;br /&gt;  Call PutPin( MiddleYellow, LEDoff )&lt;br /&gt;  Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;  Call PutPin( TopRed, LEDoff )&lt;br /&gt;  Call PutPin( BottomRed, LEDoff )&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt; if Interval &gt; 146 then&lt;br /&gt;  if Interval &lt;= 292 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDoff )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDoff )&lt;br /&gt;   Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt; if Interval &gt; 292 then&lt;br /&gt;  if Interval &lt;= 438 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDoff )&lt;br /&gt;   Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt; if Interval &gt; 438 then&lt;br /&gt;  if Interval &lt;= 585 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDoff )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt; if Interval &gt; 585 then&lt;br /&gt;  if Interval &lt;= 731 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDon )&lt;br /&gt;   Call PutPin( TopRed, LEDoff )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt; if Interval &gt; 731 then&lt;br /&gt;  if Interval &lt;= 877 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDon )&lt;br /&gt;   Call PutPin( TopRed, LEDon )&lt;br /&gt;   Call PutPin( BottomRed, LEDoff )&lt;br /&gt;  end if&lt;br /&gt; end if&lt;br /&gt;&lt;br /&gt; if Interval &gt; 877 then&lt;br /&gt;  if Interval &lt;= 1023 then&lt;br /&gt;   Call PutPin( TopGreen, LEDon )&lt;br /&gt;   Call PutPin( BottomGreen, LEDon )&lt;br /&gt;   Call PutPin( TopYellow, LEDon )&lt;br /&gt;   Call PutPin( MiddleYellow, LEDon )&lt;br /&gt;   Call PutPin( BottomYellow, LEDon )&lt;br /&gt;   Call PutPin( TopRed, LEDon )&lt;br /&gt;   Call PutPin( BottomRed, LEDon )&lt;br /&gt;  end if&lt;br /&gt; end if  &lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;I didn't know a very good way to write the code for the switch, I thought I would have to use a lot of combined if statements, but then I decided that for what I was doing, in the initial check I wasn't going to care what switches were thrown specifically, I only needed to know how many were up.  So I created a local Integer called NotSwitched that would just keep track of the number of switches off.  If no switches were flipped it would do the metronome loader, if a switch is flipped it will run that program, everything else would buzz.  This would need to be in a loop so this switch would contstantly be updating their status.  Originally I had a lot of problems getting code to work properly.  It would run when you turned on the device but if you switched a toggle during operation, it wouldn't change anything.  This was beause I had written my code with inifinite loops in the programs (the original plan was to do loops in the programs themselves), so the code would start in the main but then would get trapped and wouldn't go back to scan for switch changes.  I realized that if I used a constantly looping main I could just let that loop run the programs as long as need be over and over again as well as allow me to listen for the switches at the same time.   &lt;br /&gt;&lt;br /&gt;          do&lt;br /&gt;  NotSwitched = CInt( GetPin( SwitchOne ) ) + &lt;br /&gt;                              CInt( GetPin( SwitchTwo ) ) + &lt;br /&gt;                              CInt( GetPin( SwitchThree ) ) + &lt;br /&gt;                              CInt( GetPin( SwitchFour ) ) + &lt;br /&gt;                              CInt( GetPin( SwitchFive ) )&lt;br /&gt;  &lt;br /&gt;  if NotSwitched = 5 then&lt;br /&gt;   Call PutPin( Buzzer, LEDoff )&lt;br /&gt;   Call OptionNone()&lt;br /&gt;  end if &lt;br /&gt;  &lt;br /&gt;  if NotSwitched = 4 then&lt;br /&gt;   Call PutPin( Buzzer, LEDoff )&lt;br /&gt;   &lt;br /&gt;   if GetPin( SwitchOne ) = 0 then&lt;br /&gt;    Call OptionOne() &lt;br /&gt;   end if&lt;br /&gt;   &lt;br /&gt;   if GetPin( SwitchTwo ) = 0 then&lt;br /&gt;    Call OptionTwo() &lt;br /&gt;   end if&lt;br /&gt;   &lt;br /&gt;   if GetPin( SwitchThree ) = 0 then&lt;br /&gt;    Call OptionThree() &lt;br /&gt;   end if&lt;br /&gt;   &lt;br /&gt;   if GetPin( SwitchFour ) = 0 then&lt;br /&gt;    Call OptionFour() &lt;br /&gt;   end if&lt;br /&gt;   &lt;br /&gt;   if GetPin( SwitchFive ) = 0 then&lt;br /&gt;    Call OptionFive() &lt;br /&gt;   end if&lt;br /&gt;  &lt;br /&gt;  else&lt;br /&gt;   Call PutPin( Buzzer, LEDon )&lt;br /&gt;  end if&lt;br /&gt; loop&lt;br /&gt;&lt;br /&gt;Lastly I knew I would need to make the default program: the metronome.  After my previous work with my main method out of the way, I created another sub for option of no switches being thrown.  I knew I would just want the light to flash on and then off but I didn't know how to devise the timing change.  Then I realized that since there was a max value, all I had to do was divide by an approriate value and I could generate approriate values based on the potentiometer. I kept running in to compile errors, it wouldn't let the data types I wanted to used be used together.  Then I got the code to compile but it only had two noticeably different speeds, fast blink and slow blink depending on where the pot was turned.  Then after printing the values I was getting for the Tempo I realized that I was losing precision so the only times that the chip were reading were 0, 1, and 2.  After playing around a little bit I was able to find a type similiar to a Double in Java, Single. By using singles and converting to singles I was able to get numbers with decimals which allowed me to divide with much more accuracy and thus a much better seletion of tempo than just 2 or 3.  &lt;br /&gt;&lt;br /&gt; Dim Interval As Single &lt;br /&gt; Interval =  CSng( GetADC( Knob ) )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; Call PutPin( Buzzer, LEDoff )&lt;br /&gt; Call PutPin( TopGreen, LEDon )&lt;br /&gt; Call PutPin( BottomGreen, LEDon )&lt;br /&gt; Call PutPin( TopYellow, LEDon )&lt;br /&gt; Call PutPin( MiddleYellow, LEDon )   &lt;br /&gt; Call PutPin( BottomYellow, LEDon )&lt;br /&gt; Call PutPin( TopRed, LEDon )&lt;br /&gt; Call PutPin( BottomRed, LEDon )&lt;br /&gt; Call Delay( ( Interval / CSng( 500 ) ) + 0.05 )&lt;br /&gt; Call PutPin( TopGreen, LEDoff )&lt;br /&gt; Call PutPin( BottomGreen, LEDoff )&lt;br /&gt; Call PutPin( TopYellow, LEDoff )&lt;br /&gt; Call PutPin( MiddleYellow, LEDoff )&lt;br /&gt; Call PutPin( BottomYellow, LEDoff )&lt;br /&gt; Call PutPin( TopRed, LEDoff ) &lt;br /&gt; Call PutPin( BottomRed, LEDoff )&lt;br /&gt; Call Delay( ( Interval / CSng( 500 ) ) + 0.05)&lt;br /&gt;&lt;br /&gt;I wish I had started sooner so I could have put even more in my project, but I feel comfortable knowing that I worked extremely hard on what I have and that what I have is complete without any errors and blinks pretty darn cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114484096197718815?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114484096197718815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114484096197718815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114484096197718815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114484096197718815'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/04/end-is-near.html' title='THE END IS NEAR!'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114466335250410362</id><published>2006-04-10T02:09:00.000-07:00</published><updated>2006-04-10T04:02:56.786-07:00</updated><title type='text'>The real fun starts now</title><content type='html'>4/9/06 -&lt;br /&gt;&lt;br /&gt;Due to some complications and having a lot of house errands to run this weekend, I didn't end up getting started until this morning.  I started off wanting to have this cool little numeric touchpad I got turn on a series of lights:  I would have one light for each number and when it was pressed it would toggle its light on or off.  This was a good plan until I looked at how I would have to hook this keypad up.  It has 6 pins and no labeling what-so-ever.  I did a little research on google.com but was unable to find even the model I had, let alone a pinout diagram for it.  At this point I had to switch tacks.  I decided to start off with this cool little 5-in-1 dip switch, I ran power from the each pin on one side and then the output of each pin to different I/O's on the chip.  I then wrote some simple loops and if statements to read the inputs and write out a debug statment if the switch was turned on.  This was another challenge in and of itself.  I was not familiar with the syntax for this chip, but after looking through some documentation I figured out the code that I would need:&lt;br /&gt;&lt;br /&gt;if GetPin(SwitchOne) = 1 then&lt;br /&gt;     Debug.print"Switch One On"&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;The thing I noticed was that there was a delay when I turned on the switch.  It would take about 3 seconds for the debug to start printing.  It would turn off instantly though, odd indeed.  I decided to ignore this and procede to the next step for me, to get that switch to control something.  I decided to use the green on-board LED to rule out any possible error.  The syntax wasn't too hard to catch on to and soon the light would blink on and off if you turned the switch on and turn off if flipped down.  Again the delay problem persisted.  This time I was frustrated, there was nothing in my code that could be causing this.  I looked up on google how to hook-up switches like this and realized that I needed to run a resistor to ground, so I did that.  Now the switch would activate the blinking light and turn it off instantaneously.  Next up I connected the other 4 switches and wrote the code to make them do something similiar.  To match the 4 added switches, I added four external LED lights of different shades, running each Pos lead into an I/O pin on the chip and the Neg lead (the shorter one) to a one row in the board. I ran a resistor from that row to the ground on the side in order to prevent over-current.  I played around with a little bit of random function and came up with a cool pseudo-algorithm that has some neaty blinky things going on.  One thing I notice is that my soldered cable is not the best and I may want to redo it before the next project as it has been giving me gried for the last hour or so.  Below is my chip's code, It's simple but effective I think.&lt;br /&gt;&lt;br /&gt;Option Explicit&lt;br /&gt;&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Public Sub Main()&lt;br /&gt;&lt;br /&gt;    Do&lt;br /&gt;  Call SwitchOne&lt;br /&gt;  Call SwitchTwo&lt;br /&gt;  Call SwitchThree&lt;br /&gt;  Call SwitchFour&lt;br /&gt;  Call SwitchFive&lt;br /&gt;        &lt;br /&gt;    Loop&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'-------------------------------------------------------------------------------&lt;br /&gt;Private Sub SwitchOne()&lt;br /&gt;&lt;br /&gt;    Const SwOne As Byte = 8&lt;br /&gt;    Const OneOut As Byte = 16&lt;br /&gt;    Const LEDon As Byte = 1&lt;br /&gt;    Const LEDoff As Byte = 0&lt;br /&gt;  &lt;br /&gt; Dim Xrand As Integer &lt;br /&gt;&lt;br /&gt; ' Configure pin&lt;br /&gt; Call PutPin(SwOne, bxInputTristate)&lt;br /&gt;&lt;br /&gt;      if GetPin(SwOne) = 1 then&lt;br /&gt;        Call PutPin(OneOut, LEDoff)&lt;br /&gt;      end if&lt;br /&gt;&lt;br /&gt;  if GetPin(SwOne) = 0 then&lt;br /&gt;    Call PutPin(OneOut, LEDon)&lt;br /&gt;       Call Delay(0.11 * Rnd) &lt;br /&gt;       Call PutPin(OneOut, LEDoff)&lt;br /&gt;&lt;br /&gt;       Call Delay(0.11 * Rnd)&lt;br /&gt;  end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub SwitchTwo()&lt;br /&gt;&lt;br /&gt;    Const SwTwo As Byte = 9&lt;br /&gt;    Const TwoOut As Byte = 15&lt;br /&gt;    Const LEDon As Byte = 1&lt;br /&gt;    Const LEDoff As Byte = 0&lt;br /&gt;&lt;br /&gt; ' Configure pin&lt;br /&gt; Call PutPin(SwTwo, bxInputTristate)&lt;br /&gt;&lt;br /&gt;      if GetPin(SwTwo) = 1 then&lt;br /&gt;        Call PutPin(TwoOut, LEDoff)&lt;br /&gt;      end if&lt;br /&gt;&lt;br /&gt;  if GetPin(SwTwo) = 0 then&lt;br /&gt;    Call PutPin(TwoOut, LEDon)&lt;br /&gt;       Call Delay(0.22 * Rnd)&lt;br /&gt;       Call PutPin(TwoOut, LEDoff)&lt;br /&gt;&lt;br /&gt;        Call Delay(0.22* Rnd)&lt;br /&gt;  end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub SwitchThree()&lt;br /&gt;&lt;br /&gt;    Const SwThree As Byte = 10&lt;br /&gt;    Const ThreeOut As Byte = 14&lt;br /&gt;    Const LEDon As Byte = 1&lt;br /&gt;    Const LEDoff As Byte = 0&lt;br /&gt;&lt;br /&gt; ' Configure pin&lt;br /&gt; Call PutPin(SwThree, bxInputTristate)&lt;br /&gt;&lt;br /&gt;      if GetPin(SwThree) = 1 then&lt;br /&gt;        Call PutPin(ThreeOut, LEDoff)&lt;br /&gt;      end if&lt;br /&gt;&lt;br /&gt;  if GetPin(SwThree) = 0 then&lt;br /&gt;    Call PutPin(ThreeOut, LEDon)&lt;br /&gt;       Call Delay(0.33 * Rnd)&lt;br /&gt;       Call PutPin(ThreeOut, LEDoff)&lt;br /&gt;&lt;br /&gt;        Call Delay(0.33 * Rnd)&lt;br /&gt;  end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub SwitchFour()&lt;br /&gt;&lt;br /&gt;    Const SwFour As Byte = 11&lt;br /&gt;    Const FourOut As Byte = 13&lt;br /&gt;    Const LEDon As Byte = 1&lt;br /&gt;    Const LEDoff As Byte = 0&lt;br /&gt;&lt;br /&gt; ' Configure pin&lt;br /&gt; Call PutPin(SwFour, bxInputTristate)&lt;br /&gt;&lt;br /&gt;     if GetPin(SwFour) = 1 then&lt;br /&gt;        Call PutPin(FourOut, LEDoff)&lt;br /&gt;      end if&lt;br /&gt;&lt;br /&gt;  if GetPin(SwFour) = 0 then&lt;br /&gt;    Call PutPin(FourOut, LEDon)&lt;br /&gt;       Call Delay(0.44 * Rnd)&lt;br /&gt;       Call PutPin(FourOut, LEDoff)&lt;br /&gt;&lt;br /&gt;        Call Delay(0.44 * Rnd)&lt;br /&gt;  end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;br /&gt;Private Sub SwitchFive()&lt;br /&gt;&lt;br /&gt;    Const SwFive As Byte = 12&lt;br /&gt;    Const FiveOut As Byte = 25&lt;br /&gt;    Const LEDon As Byte = 0&lt;br /&gt;    Const LEDoff As Byte = 1&lt;br /&gt;&lt;br /&gt; ' Configure pin&lt;br /&gt; Call PutPin(SwFive, bxInputTristate)&lt;br /&gt;&lt;br /&gt;      if GetPin(SwFive) = 1 then&lt;br /&gt;        Call PutPin(FiveOut, LEDoff)&lt;br /&gt;      end if&lt;br /&gt;&lt;br /&gt;  if GetPin(SwFive) = 0 then&lt;br /&gt;    Call PutPin(FiveOut, LEDon)&lt;br /&gt;       Call Delay(0.55 * Rnd)&lt;br /&gt;       Call PutPin(FiveOut, LEDoff)&lt;br /&gt;&lt;br /&gt;        Call Delay(0.55 * Rnd)&lt;br /&gt;  end if&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;'------------------------------------------------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114466335250410362?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114466335250410362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114466335250410362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114466335250410362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114466335250410362'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/04/real-fun-starts-now.html' title='The real fun starts now'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114465914348276917</id><published>2006-04-10T01:40:00.000-07:00</published><updated>2006-04-10T02:09:13.280-07:00</updated><title type='text'>It took a while but we're back on track...?</title><content type='html'>4/7/06 - &lt;br /&gt;&lt;br /&gt;I finally got my female to female serial cable and I would like to say that this has helped me procede in my project greatly, but that would be a horrible nasty lie.  This bugger had me stumped for quite a while, and even now I feel like I just wasted my time. I had installed BasicX on my computer and also double clicked the registry entry to get the serial port to work, but whenever I tried to get the bx-24 to communicate with my computer it would give me gibberish.  I tried flipping the cable around so I would be trying different ports but nothing brought me success.  I finally decided that I should test the cable and see which wires went to where:  the wires just pass straight through (like a null modem cable).  Then I looked up which headers (linked to the pins on the chip) did what using the word document on mycourses.  Then I did the same for a standard serial cable using google and figured out which should go to which.  I soldered four attached headers to four wires with individual headers on the other end.  I pushed the four strip into the correct spot on the board and then the individual pins into the correct holes in the cable.  THIS TIME SUCCESS!  It welcomed me to the BX-24 and started running the "Hello World" program.  I looked up the example code for the green-red LED flasher and using that created my own version of it and tried to comiple and run it to see if that would work as well.  This completed as well and soon only green led was flashinbg lopsidedly.  I decided at this point that I had had enough for a night and would come back to start doing my own hardwiring and project ideas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114465914348276917?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114465914348276917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114465914348276917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114465914348276917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114465914348276917'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/04/it-took-while-but-were-back-on-track.html' title='It took a while but we&apos;re back on track...?'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25773908.post-114465744842794531</id><published>2006-04-10T00:38:00.000-07:00</published><updated>2006-04-10T01:40:24.930-07:00</updated><title type='text'>Eventful Beginnings</title><content type='html'>NOTE-  I have been keeping a private journal of my work in a written diary and I am just now transcribing it to digital.&lt;br /&gt;&lt;br /&gt;4/3/06 -&lt;br /&gt;&lt;br /&gt;Even though we went out to Rockwood electronics a few days ago, I really couldn't get started because I was lacking one very crucial ingredient: my BX-24.  After I got my new microprocessor today in class, I couldn't wait to get home and start playing around.  When I got home, I spent a little time setting up a little work area for myself.  I used a small coffee table and organized all my necessities I would be needing (my laptop, soldering iron and equipment, bread board).  Placing the stamp into the board proved to be easy enough, as did setting up the power conditioner but I quickly realized I was going to hit a wall as I did not have a serial cable.  I installed the headers and soldered some more headers onto the 9v battery connector and finished running power lines to the side strips.  After checking everything was attached like the pictures, I plugged in the battery and the lights flashed red and green, so I assume that everything is hooked up correctly.  I am not quite sure what I would like to do for my project yet, but I am going to start brainstorming and by the time I have my cable I should be ready to get cracking.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25773908-114465744842794531?l=extremephysicalcomputingadventrures.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://extremephysicalcomputingadventrures.blogspot.com/feeds/114465744842794531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25773908&amp;postID=114465744842794531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114465744842794531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25773908/posts/default/114465744842794531'/><link rel='alternate' type='text/html' href='http://extremephysicalcomputingadventrures.blogspot.com/2006/04/eventful-beginnings.html' title='Eventful Beginnings'/><author><name>Dan Getta</name><uri>http://www.blogger.com/profile/14228397298994818792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
