<?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-8287986</id><updated>2011-04-21T16:19:57.898-07:00</updated><title type='text'>Physical Computing Journal</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8287986.post-110311677051236701</id><published>2004-12-15T10:18:00.000-08:00</published><updated>2004-12-15T16:28:17.220-08:00</updated><title type='text'>Group Project 3 - Blackjack 2</title><content type='html'>Lamar Hines and I have decided to continue working on the blackjack game project and have asked Rich Hauck to join us. We want to extend the functionality of the game and also make a few changes in the interface and messaging. In addition to changes we already had in mind, we decided to get some more user feedback to see what else we should work on. Here's what we found as well as some of my thoughts about these issues:&lt;br /&gt;&lt;br /&gt;GAME PLAY SPEED ISSUE: Most users seemed to think that the game sequence was to slow, often users would see the text stating that it was dealing to player/dealer or hitting player/dealer and the user would be attempting to perform an action. As a result, we sped up the dealing portion of the game so that the initial card hand for both dealer and player are dealt in about 4 seconds. Users felt like this amount of time was much better than before, when it took about 8 seconds.&lt;br /&gt;&lt;br /&gt;DESIRE FOR CLEAR USER FEEDBACK: Users seemed to want more visual details. People stated that they would prefer to know how many cards they had rather than just having the value amount of the cards. Furthermore, multiple users stated that they would prefer to see a graphic representation of the cards. So we changed the text from "Hitting Dealer ...., Hitting Player ....." to "Dealing to Dealer, Dealing to Player". Now the cards are dealt much more quickly and instead of displaying the total value of the cards of each, we display only the individual card values since adding the values of the cards together is an integral part of the game experience.&lt;br /&gt;&lt;br /&gt;QPROX v. DIGITAL BUTTON INTERFACE: Some users felt that the qprox buttons were just as effective as actual buttons; however, others felt that they should be able to feel something to capture the natural impulsive nature of gambling. Also, all users agreed that consistency issues need to be addressed with the current button functionality. After some discussion, we decided that QProx buttons only make sense for those actions in the game which normally require hand motions, i.e., hit and stay. So all other buttons, including game reset, bidding, and doubling down would be standard digital buttons.&lt;br /&gt;&lt;br /&gt;THE UNFAMILIAR PARTY: Users that were unfamiliar with game felt that some sort of instructions should be available. I felt like this is just an unavoidable problem in that there are simply people who don't know how to play blackjack. I feel like it isn't our responsibility/duty to tell them how to play. If they want to play, they can ask us or they can learn the basic rules elsewhere.&lt;br /&gt;&lt;br /&gt;BIDDING: One users stated that they would prefer to have a range of digital buttons for bidding. Hitting buttons made a user think more of the consequences of their actions. We decided to use digital buttons for bidding, not only because users expressed such a preference, but also because, as stated above, it makes sense from an interaction design perspective not to use QProx sensors for such actions.&lt;br /&gt;&lt;br /&gt;OVERALL: Most users agreed that a strong audio and/or visual guide would help to make the user interface more intuitive. Some audio or visual prompts might be helpful for inexperienced players. But, in my opinion, similar to the issue of players who don't know how to play blackjack, we should not implement functionality such as tips or advice or things like that. It might make the user experience richer, but the game is not intended to be an instructional tool. Separately, users stated that performance issues need to be addressed for consistency. The QProx sensors are a little cranky. Sometimes it seems they can be either too sensitive or not sensitive enough. I'm not sure if this is an inherent bug or if it is a problem with our implementation.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;PROBLEMS/SOLUTIONS&lt;br /&gt;&lt;br /&gt;- multiple LCD implementation&lt;br /&gt;&lt;br /&gt;We spent a lot of time trying different ways to implement multiple LCDs two basic ways:&lt;br /&gt;&lt;br /&gt;1) multiplexer - At James Robinson's recommendation, we initially bought a multiplexer down on Canal Street. Unfortunately, it came with no documentation and we were unable to find any documentation online or anywhere else. After many attempts to figure out how to use the multiplexer, we decided to try another approach, which was the original recommendation of Tom Igoe.&lt;br /&gt;&lt;br /&gt;2) multiple PICs - We tried this for a while using a couple of different code architectures. Initially, all the logic code sat on one PIC and it was supposed to simply send out messages to be displayed to the other PIC to send to the LCD. However, sending out text messages is difficult since PIC Basic only supports one character strings. We tried for a while to create an array that would contain all the characters of any string we wanted to display, but couldn't get the array to print out correctly on the 2nd LCD. At this point, we had only a week left to finish the other functionality we wanted to implement like bidding and to get the box buttoned up and looking nice. So we decided to go with a single 2-line LCD.&lt;br /&gt;&lt;br /&gt;- bidding&lt;br /&gt;&lt;br /&gt;The code for bidding was fairly simple. We created a while loop that looks for a flag that is set only when a user presses one of the bid buttons. Initally though, there were values coming in from the bid buttons as a result of not using the correct resistor in conjunction with those buttons. We kept thinking it was a code problem, but once we were satisfied that it couldn't be the code, we tried different resistors on the buttons and eventually found a type that worked.&lt;br /&gt;&lt;br /&gt;- double down/split&lt;br /&gt;&lt;br /&gt;We really wanted to initially implement this functionality but simply ran out of time while focusing on what we considered the core things we wanted to accomplish--better messaging, faster gameplay, displaying card values, and bidding.&lt;br /&gt;&lt;br /&gt;- automatically determine the value of the ace card&lt;br /&gt;&lt;br /&gt;In the first version of the game, there were 4 "1" cards and 4 "11" cards to stand for Aces. Since that's obviously incorrect, we had to put only 4 "Ace" cards in the deck and figure out a way for the game to automatically determine if the player wants to use it as a "1" or an "11". We simply put in code that would check if an "11" would put the player or the dealer over 21. If so, the value is automatically switched to a "1". In our testing, this seems to work just fine.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;FINAL USER TESTING FEEDBACK&lt;br /&gt;&lt;br /&gt;Confusion over the value of X (X user for "10" but also for dealer hidden card. This was understandably confusing.)&lt;br /&gt;LCD screen was hard to see - needed to be set at an angle&lt;br /&gt;People pressed HIT and STAY - QProx was not extremely intuitive, but was recognizable&lt;br /&gt;Overall, users really liked the interface&lt;br /&gt;Bidding was fairly intuitive&lt;br /&gt;Multiple pushes tried for bidding over single chip value&lt;br /&gt;Button Sensitivity - needed a firm press&lt;br /&gt;New players needed explanation of game, but found the experience easy&lt;br /&gt;&lt;br /&gt;The final version was kind of fragile in that basic handling seemed to cause things not to work properly, like the QProx sensors. In a future version, we'd certainly like to tackle the issue of physical fragility. But overall, I think the game was a success and player feedback was generally very positive.&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://www.davidyates.com/blackjack_code_3.txt"&gt;final code&lt;/a&gt; for the 2nd version of the blackjack game.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-110311677051236701?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/110311677051236701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=110311677051236701' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/110311677051236701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/110311677051236701'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/12/group-project-3-blackjack-2.html' title='Group Project 3 - Blackjack 2'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8287986.post-109906298196626632</id><published>2004-11-10T20:15:00.000-08:00</published><updated>2004-12-15T16:29:17.793-08:00</updated><title type='text'>Group Project 2 - Blackjack 1</title><content type='html'>This week, Lamar Hines and I are starting work on Group Project 2. We'd like to use QProx sensors in some kind of game device. We've decided to try to build an electronic blackjack game using a board, Qprox sensor chip, and 2 16x4 LCDs.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Our initial observations:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What tool or device is the action taken on?&lt;/strong&gt;&lt;br /&gt;All the action takes place on or near a table. This can be seen as players making choices like hit, stay, bid, double down etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the goal of the activity?&lt;/strong&gt;&lt;br /&gt;The primary goal of the activity is for recreation and/or gambling stakes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Observe a person or people engaged in the activity. What are the physical parameters of that activity? &lt;/strong&gt;&lt;br /&gt;The most significant physical parameters of this activity are the hand movements by the player(s) which indicate visually what they want to do in a given situation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What does the person engaged in it do with their arms, their legs, their hands or feet, their head?&lt;/strong&gt;&lt;br /&gt;All movements are generally limited to the arms and hands. General actions include hand motions that indicate a choice as well as reaching and picking up or releasing cards/chips.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do they change their posture? Where do they need to focus their attention?&lt;/strong&gt;&lt;br /&gt;General attention is on the game play area and the dealer. Posture doesn't seem to be an integral part of what they do.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Is there a secondary focus of attention (for example, if two limbs are used independently)? What physical elements of the activity make it engaging? What elements make it difficult, painful, or boring?&lt;br /&gt;&lt;/strong&gt;Players are very limited in physical movement because everything is so heavily focused and dependent upon staying stationary and using the hands.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Do the action multiple times (perhaps 100 times), or have someone else do it. Record the action, with a video camera, or sensors feeding a graphing program, or in some other way. What patterns appear when the action is repeated?&lt;br /&gt;&lt;/strong&gt;Reaching and taking with hands and arms is the most observed actions after observing the situation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the physical characteristics of the medium that you have to take as given?&lt;/strong&gt;&lt;br /&gt;We plan to take different elements like the idea of hit me, stay, and play and incorporate physical actions that will be recognized by the QProx sensors.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;We have the basic code to send "Hello World" to an LCD, but are running into difficulty getting it to display the text. We've spent a lot of time getting the code and the wiring set up properly, but have not so far been able to isolate the problem. We are going to try to get some help from Michael Schneider and from Eric Fino, both of whom have worked with LCDs and/or QProx chips before. Eric Fino has some documentation from his last group project, and it has been helpful but doesn't indicate how exactly the LCD should be wired up to the PIC/board. Eric's project: &lt;a href="http://stage.itp.nyu.edu/~ejf251/pcomp/elevatorwaitspace/"&gt;http://stage.itp.nyu.edu/~ejf251/pcomp/elevatorwaitspace/&lt;/a&gt; .&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;After working with James Robinson and attending his drive-by on LCDs, we were able to get the LCD wired up correctly and get it working. Next, I will concentrate on translating the rules of blackjack into software.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;We have a basic blackjack game working which deals random cards to a dealer and a player. After dealing two cards to each, the player must decide to hit or stay. Upon staying, the dealer automatically either takes a card if the dealer's total is below the total of the player or stays if the dealer's total is already higher than the player's total. Right now, there is no other game functionality like bidding or doubling down.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;We did some play-testing and general user feedback was positive. Many people felt the game play was a little too slow and many also thought they were supposed to "press" the QProx buttons rather than just make a hand motion directly over them. So a little explaining was necessary to have users play the game the way we envisioned.&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://www.davidyates.com/blackjack_code_2.txt"&gt;final code&lt;/a&gt; for Project 2 blackjack.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109906298196626632?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109906298196626632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109906298196626632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109906298196626632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109906298196626632'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/11/group-project-2-blackjack-1.html' title='Group Project 2 - Blackjack 1'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109867168960847830</id><published>2004-10-24T19:34:00.000-07:00</published><updated>2004-12-15T16:36:01.316-08:00</updated><title type='text'>Lab Assigment: Talk to a MIDI device</title><content type='html'>I'm just getting started on the Midi lab. I have to purchase a 5-pin DIN female connector (MIDI connector) and will start working on it again on Tuesday.&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;I got the supplies and found some code on Tom Igoe's site. In a nice turn of events, gettting this thing working was the easiest lab so far.&lt;br /&gt;&lt;br /&gt;Here's the code for sending out to a MIDI device and modifying that signal with a variable resistor:&lt;br /&gt;&lt;br /&gt;URL: &lt;a href="http://stage.itp.tsoa.nyu.edu/~tigoe/pcomp/code/archives/midinotes.bas"&gt;http://stage.itp.tsoa.nyu.edu/~tigoe/pcomp/code/archives/midinotes.bas&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;DEFINE OSC 20&lt;br /&gt;DEFINE ADC_BITS 10 ' Set number of bits in result&lt;br /&gt;DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)&lt;br /&gt;DEFINE ADC_SAMPLEUS 15 ' Set sampling time in uS&lt;br /&gt;' set up serial UART registers:&lt;br /&gt;define HSER_RCSTA 90h ' enable the receive register&lt;br /&gt;define HSER_TXSTA 20h ' enable the transmit register&lt;br /&gt;define HSER_BAUD 31250 ' set the baud rate&lt;br /&gt;TRISA = %11111111 ' Set PORTA to all input&lt;br /&gt;' Set up ADCON1&lt;br /&gt;ADCON1 = %10000010&lt;br /&gt;' declare an array of 12 word variables:&lt;br /&gt;pitch var byte(12)&lt;br /&gt;' declare other variables:&lt;br /&gt;note var byte&lt;br /&gt;ADCVar var word&lt;br /&gt;' the 12 elements of the array called pitch are the 12 notes of a scale:&lt;br /&gt;pitch(0) = 60 ' middle C&lt;br /&gt;pitch(1) = 61 ' C#&lt;br /&gt;pitch(2) = 62 ' D&lt;br /&gt;pitch(3) = 63 ' D#&lt;br /&gt;pitch(4) = 64 ' E&lt;br /&gt;pitch(5) = 65 ' F&lt;br /&gt;pitch(6) = 66 ' F#&lt;br /&gt;pitch(7) = 67 ' G&lt;br /&gt;pitch(8) = 68 ' G#&lt;br /&gt;pitch(9) = 69 ' A&lt;br /&gt;pitch(10) = 70 ' A#&lt;br /&gt;pitch(11) = 71 ' B&lt;br /&gt;main:&lt;br /&gt;' My potentiometer gave a range from 0 to 1023:&lt;br /&gt;ADCin 0, ADCVar&lt;br /&gt;' convert to a range from 0 to 11:&lt;br /&gt;Note = ADCVar / 100&lt;br /&gt;' play note:&lt;br /&gt;hserout [$90, pitch(note),$40]&lt;br /&gt;pause 250&lt;br /&gt;' noteoff:&lt;br /&gt;hserout [$80, pitch(note), $00]&lt;br /&gt;goto main&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109867168960847830?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109867168960847830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109867168960847830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109867168960847830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109867168960847830'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/10/lab-assigment-talk-to-midi-device.html' title='Lab Assigment: Talk to a MIDI device'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109821953544473286</id><published>2004-10-17T13:58:00.000-07:00</published><updated>2004-12-15T16:37:06.313-08:00</updated><title type='text'>Lab Assignment: Serial output and Talking to Processing</title><content type='html'>I had some initial trouble with this code as I'm not taking ICM this semester and so am not familiar with Processing. Fortunately, John Schimmel was around to help me out and answer questions.&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;code for Processing&lt;br /&gt;&lt;br /&gt;float[] data = new float[2]; // create 2 space data array. 1) Potentiometer and 2) photocell&lt;br /&gt;int index=0;&lt;br /&gt;float xpos;&lt;br /&gt;int bck;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;size(255,255);&lt;br /&gt;beginSerial(); //begin serial communication thing&lt;br /&gt;serialWrite(65); //talk to PIC . like saying hello&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;background(bck);&lt;br /&gt;fill(0,0,244);&lt;br /&gt;ellipse(xpos, 100, 50,50); //movable circle&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void serialEvent() { //automatic serial listener&lt;br /&gt;data[index] = serial; // save messages to data array&lt;br /&gt;index=index+1; // increment serial counter&lt;br /&gt;if (index==2) { // both messages received&lt;br /&gt;xpos = float(data[0]); // rename the first message to xpos&lt;br /&gt;bck = int(data[1]); //save photocell value&lt;br /&gt;serialWrite(65); // responsd back to PIC&lt;br /&gt;index = 0; // reset serial counter to zero&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;code for PIC&lt;br /&gt;&lt;br /&gt;input portc.7&lt;br /&gt;output portc.6&lt;br /&gt;inputVar VAR byte&lt;br /&gt;sensorValue VAR WORD ' Create variable to store result&lt;br /&gt;photoValue VAR WORD&lt;br /&gt;' POTENTIOMETER SETUP'&lt;br /&gt;Define ADCIN parameters&lt;br /&gt;DEFINE ADC_BITS 10 ' Set number of bits in result&lt;br /&gt;DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)&lt;br /&gt;DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS&lt;br /&gt;TRISA = %11111111 ' Set PORTA to all input&lt;br /&gt;ADCON1 = %10000010 ' Set PORTA analog and right justify result&lt;br /&gt;PAUSE 500 ' Wait .5 second'&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;&lt;br /&gt;ADCIN 0, sensorValue 'potentiometer variable&lt;br /&gt;ADCIN 1, photoValue 'photocell&lt;br /&gt;sensorValue = sensorValue/4 'divide the value because it's too big'&lt;br /&gt;&lt;br /&gt;----------------------&lt;br /&gt;&lt;br /&gt;' THE LISTENING CODE - puts message into inputVar&lt;br /&gt;serin2 portc.7, 16468, [inputVar] 'listening for potentiometer value&lt;br /&gt;if inputVar=65 then ' if received message is 65, then respond to processing&lt;br /&gt;gosub blink 'blink LED'&lt;br /&gt;usage: serout2 dataPin, mode, [data]&lt;br /&gt;serout2 portc.6, 16468, [sensorValue,photoValue] 'talk to processing&lt;br /&gt;ENDif&lt;br /&gt;&lt;br /&gt;goto main&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;blink:&lt;br /&gt;&lt;br /&gt;high portd.2&lt;br /&gt;pause 250&lt;br /&gt;low portd.2&lt;br /&gt;pause 250&lt;br /&gt;return&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109821953544473286?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109821953544473286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109821953544473286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109821953544473286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109821953544473286'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/10/lab-assignment-serial-output-and.html' title='Lab Assignment: Serial output and Talking to Processing'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109821956626135361</id><published>2004-10-10T13:59:00.000-07:00</published><updated>2004-12-15T05:19:53.183-08:00</updated><title type='text'>Group Project 1 - Chair massager</title><content type='html'>The group project has gone well so far. We finally have the chair massager working the way we want. It's been a fun project. It took a while to figure out how the wiring worked inside the massager and then to figure out how to bypass the controller that came with it and set it up with a switch that turns on automatically when you sit down. Thanks to a couple of 2nd year students, we sorted it out. We still need to solder a couple things in permanently and then to hide all the wiring inside the massager, so that only the wire that plugs in to the power source is coming out of it.&lt;br /&gt;&lt;br /&gt;The code for the PIC was very simple. It was a simple main method with a pause at the beginning, then a specified number of milliseconds (around 8 minutes) until it sent a signal to the relay switch which turned on the massager.&lt;br /&gt;&lt;br /&gt;We set up the chair massager in the computer lab without telling anyone what is was or how it worked. We recorded about 4 people sitting in the massage chair. Each has a different response to it. 3 of the people were surprised when the chair started vibrating (of course) and decided to use a different chair. One person wasn't surprised at all since he saw the wiring and was expecting something to happen.&lt;br /&gt;&lt;br /&gt;I don't think our idea of having the massage chair sitting in the computer lab as a surprise was a good idea. I think the chair massager should have been set up in the lounge area and should have had some explanation attached to it. Rather than having it in the computer lab, I think it would have been nice to have it on a chair in the lounge area. When people sat down, they would get a nice massage for maybe 15 min. The massager would automatically shut off then and be ready for the next person to get a massage. This would seem to be a much more logical and practical use for the chair massager--a tool for taking a break and relaxing in the lounge area.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109821956626135361?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109821956626135361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109821956626135361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109821956626135361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109821956626135361'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/10/group-project-1-chair-massager.html' title='Group Project 1 - Chair massager'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109685752845790939</id><published>2004-10-04T19:32:00.000-07:00</published><updated>2004-12-15T16:34:33.816-08:00</updated><title type='text'>Lab assignment: servo/analog out</title><content type='html'>Lab 4 was interesting. It took a little time to get my head around it and I'm still figuring out the syntax of the language, but I got it done and it works properly. I've also helped a couple other people with their stuff and explaining things to others always helps me to learn it better.&lt;br /&gt;&lt;br /&gt;Here's my code from Lab 4:&lt;br /&gt;&lt;br /&gt;'****************************************************************&lt;br /&gt;'* Name : lab_4_1.BAS *&lt;br /&gt;'* Author : [select VIEW...EDITOR OPTIONS] *&lt;br /&gt;'* Notice : Copyright (c) 2004 [select VIEW...EDITOR OPTIONS] *&lt;br /&gt;'* : All Rights Reserved *&lt;br /&gt;'* Date : 10/6/2004 *&lt;br /&gt;'* Version : 1.0 *&lt;br /&gt;'* Notes : *&lt;br /&gt;'* : *&lt;br /&gt;'****************************************************************&lt;br /&gt;DEFINE OSC 4&lt;br /&gt;DEFINE ADC_BITS 10 ' Set number of bits in result&lt;br /&gt;DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)&lt;br /&gt;DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS&lt;br /&gt;sensorValue Var word ' Create variable to store result&lt;br /&gt;start:&lt;br /&gt;pulseWidth var byte ' set up constants with the minimum and maximum pulsewidths&lt;br /&gt;minPulse CON 50&lt;br /&gt;maxPulse CON 250&lt;br /&gt;refreshPeriod CON 20 ' set up a constant with the time between pulses:&lt;br /&gt;pulseWidth = minPulse ' set an initial pulsewidth:&lt;br /&gt;pulseRange var word&lt;br /&gt;pulseRange = maxPulse - minPulse&lt;br /&gt;main:&lt;br /&gt;Low PORTC.3 ' take the output pin low so we can pulse it high&lt;br /&gt;adcin 0, sensorValue&lt;br /&gt;PulsOut PORTC.3, pulseWidth ' pulse the pin&lt;br /&gt;Pause refreshPeriod ' pause for as long as needed:&lt;br /&gt;pulseWidth = minPulse + (pulseRange * (sensorValue/10)) / 100&lt;br /&gt;&lt;br /&gt;GoTo main&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;'****************************************************************&lt;br /&gt;'* Name : lab_4_2.BAS *&lt;br /&gt;'* Author : DAVID YATES *&lt;br /&gt;'* Notice : Copyright (c) 2004 [select VIEW...EDITOR OPTIONS] *&lt;br /&gt;'* : All Rights Reserved *&lt;br /&gt;'* Date : 9/26/2004 *&lt;br /&gt;'* Version : 1.0 *&lt;br /&gt;'* Notes : *&lt;br /&gt;'* : *&lt;br /&gt;'****************************************************************&lt;br /&gt;start:&lt;br /&gt;pulseWidth var byte&lt;br /&gt;' set up constants with the minimum and maximum pulsewidths&lt;br /&gt;minPulse CON 50&lt;br /&gt;maxPulse CON 250&lt;br /&gt;' set up a constant with the time between pulses:&lt;br /&gt;refreshPeriod CON 20&lt;br /&gt;&lt;br /&gt;' set an initial pulsewidth:&lt;br /&gt;pulseWidth = minPulse&lt;br /&gt;main:&lt;br /&gt;'take the output pin low so we can pulse it high&lt;br /&gt;Low PORTC.3&lt;br /&gt;' pulse the pin&lt;br /&gt;PulsOut PORTC.3, pulseWidth&lt;br /&gt;' pause for as long as needed:&lt;br /&gt;Pause refreshPeriod&lt;br /&gt;&lt;br /&gt;' change the angle for the next time around:&lt;br /&gt;IF pulseWidth &gt; maxPulse Then&lt;br /&gt;pulseWidth = minPulse&lt;br /&gt;Else&lt;br /&gt;pulseWidth = pulseWidth + 1&lt;br /&gt;Endif&lt;br /&gt;&lt;br /&gt;GoTo main&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109685752845790939?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109685752845790939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109685752845790939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109685752845790939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109685752845790939'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/10/lab-assignment-servoanalog-out.html' title='Lab assignment: servo/analog out'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109907802593629713</id><published>2004-09-25T18:51:00.000-07:00</published><updated>2004-12-15T16:34:49.930-08:00</updated><title type='text'>Lab Assignment: Variables and Analog Input Analog in; tracking changes with variables; practical jokes </title><content type='html'>Lab: Variables and Analog Input&lt;br /&gt;&lt;br /&gt;This lab was rather time-consuming and indeed I did not finish all of the steps. But I did finish most of them. Here's code for steps 1-3.&lt;br /&gt;&lt;br /&gt;Code for Step 1:&lt;br /&gt;&lt;br /&gt;'****************************************************************&lt;br /&gt;'* Name : LAB_3_1.BAS *&lt;br /&gt;'* Author : DAVID YATES *&lt;br /&gt;'* Notice : Copyright (c) 2004 [select VIEW...EDITOR OPTIONS] *&lt;br /&gt;'* : All Rights Reserved *&lt;br /&gt;'* Date : 9/24/2004 *&lt;br /&gt;'* Version : 1.0 *&lt;br /&gt;'* Notes : *&lt;br /&gt;'* : *'****************************************************************&lt;br /&gt;' PicBasic Pro program to display result of' 10-bit A/D conversion through serial at 9600 baud'&lt;br /&gt;' Connect analog input to channel-0 (RA0)&lt;br /&gt;' Define ADCIN parameters&lt;br /&gt;DEFINE ADC_BITS 10 ' Set number of bits in result&lt;br /&gt;DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)&lt;br /&gt;DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS&lt;br /&gt;ADCvar VAR WORD ' Create variable to store result&lt;br /&gt;TRISA = %11111111 ' Set PORTA to all input&lt;br /&gt;ADCON1 = %10000010 ' Set PORTA analog and right justify result&lt;br /&gt;Pause 500 ' Wait .5 second&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;&lt;br /&gt;ADCIN 0, ADCvar ' Read channel 0 to adval&lt;br /&gt;&lt;br /&gt;' print it to serial out, 'with linefeed and carriage return (10, 13)&lt;br /&gt;serout2 PORTC.6, 16468, [DEC ADCvar, 13, 10]&lt;br /&gt;&lt;br /&gt;GoTo main&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Code for Step 2:&lt;br /&gt;&lt;br /&gt;'****************************************************************&lt;br /&gt;'* Name : LAB_3_2.BAS *&lt;br /&gt;'* Author : DAVID YATES *&lt;br /&gt;'* Notice : Copyright (c) 2004 [select VIEW...EDITOR OPTIONS] *&lt;br /&gt;'* : All Rights Reserved *&lt;br /&gt;'* Date : 9/24/2004 *&lt;br /&gt;'* Version : 1.0 *&lt;br /&gt;'* Notes : *&lt;br /&gt;'* : *'****************************************************************&lt;br /&gt;' PicBasic Pro program to display result of 10-bit A/D conversion through serial at 9600 baud'&lt;br /&gt;' Connect analog input to channel-0 (RA0)&lt;br /&gt;' Define ADCIN parameters&lt;br /&gt;DEFINE ADC_BITS 10 ' Set number of bits in result&lt;br /&gt;DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)&lt;br /&gt;DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS&lt;br /&gt;ADCvar VAR WORD ' Create variable to store result&lt;br /&gt;TRISA = %11111111 ' Set PORTA to all input&lt;br /&gt;ADCON1 = %10000010 ' Set PORTA analog and right justify result&lt;br /&gt;Pause 500 ' Wait .5 second&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;&lt;br /&gt;ADCIN 0, ADCvar ' Read channel 0 to adval&lt;br /&gt;' print it to serial out, ' with linefeed and carriage return (10, 13)&lt;br /&gt;serout2 PORTC.6, 16468, [DEC ADCvar, 13, 10]&lt;br /&gt;&lt;br /&gt;GoTo main&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Code for Step 3:&lt;br /&gt;&lt;br /&gt;'****************************************************************&lt;br /&gt;'* Name : LAB_3_3.BAS *&lt;br /&gt;'* Author : DAVID YATES *&lt;br /&gt;'* Notice : Copyright (c) 2004 [select VIEW...EDITOR OPTIONS] *&lt;br /&gt;'* : All Rights Reserved *&lt;br /&gt;'* Date : 9/24/2004 *&lt;br /&gt;'* Version : 1.0 *&lt;br /&gt;'* Notes : *&lt;br /&gt;'* : *'****************************************************************&lt;br /&gt;switchVar var byte&lt;br /&gt;input portb.4&lt;br /&gt;output portb.7&lt;br /&gt;pause 500&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;&lt;br /&gt;switchVar = portb.4&lt;br /&gt;portb.7 = switchVar&lt;br /&gt;&lt;br /&gt;goto main&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;I did further work on the other steps in the Lab but did not save them out separately from the machine I was working on.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109907802593629713?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109907802593629713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109907802593629713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109907802593629713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109907802593629713'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/09/lab-assignment-variables-and-analog.html' title='Lab Assignment: Variables and Analog Input Analog in; tracking changes with variables; practical jokes '/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109907797743522338</id><published>2004-09-18T13:25:00.000-07:00</published><updated>2004-12-15T16:35:07.836-08:00</updated><title type='text'>Lab Assignment: Digital input and output using the PIC microcontroller</title><content type='html'>Lab: Digital Input and output using the microcontroller&lt;br /&gt;&lt;br /&gt;I connected and LED and a 220k Ohm resistor to each of the pins at portd.0 to portd.7 on my PIC and used the following code:&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;&lt;br /&gt;high portd.0&lt;br /&gt;pause 500&lt;br /&gt;low portd.0&lt;br /&gt;&lt;br /&gt;high portd.1&lt;br /&gt;pause 500&lt;br /&gt;low portd.1&lt;br /&gt;&lt;br /&gt;high portd.2&lt;br /&gt;pause 500&lt;br /&gt;low portd.2&lt;br /&gt;&lt;br /&gt;high portd.3&lt;br /&gt;pause 500&lt;br /&gt;low portd.3&lt;br /&gt;&lt;br /&gt;high portd.4&lt;br /&gt;pause 500&lt;br /&gt;low portd.4&lt;br /&gt;&lt;br /&gt;high portd.5&lt;br /&gt;pause 500&lt;br /&gt;low portd.5&lt;br /&gt;&lt;br /&gt;high portd.6&lt;br /&gt;pause 500&lt;br /&gt;low portd.6&lt;br /&gt;&lt;br /&gt;high portd.7&lt;br /&gt;pause 500&lt;br /&gt;low portd.7&lt;br /&gt;&lt;br /&gt;high portd.8&lt;br /&gt;pause 500&lt;br /&gt;low portd.8&lt;br /&gt;&lt;br /&gt;goto main&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Next we were supposed to use a switch to turn on/off another LED. This worked fairly easily and worked the first time I tried it. Here's the code:&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;input portb.0&lt;br /&gt;output portd.1&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;if portb.0 = 1 then ' if the switch is closed on pin RB0&lt;br /&gt;low portd.1 ' set pin RD1 low&lt;br /&gt;else&lt;br /&gt;high portd.1 ' set RD1 high&lt;br /&gt;endif&lt;br /&gt;goto main&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109907797743522338?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109907797743522338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109907797743522338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109907797743522338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109907797743522338'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/09/lab-assignment-digital-input-and.html' title='Lab Assignment: Digital input and output using the PIC microcontroller'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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-8287986.post-109494826245372336</id><published>2004-09-11T17:14:00.000-07:00</published><updated>2004-12-15T16:35:21.973-08:00</updated><title type='text'>Lab assignment: Basic Electronics</title><content type='html'>Lab 1&lt;br /&gt;&lt;br /&gt;I finished almost all of Lab 1 today. I went shopping for all the supplies I needed and then was at the shop for a few hours. Fortunately, there were a couple of people there who were able to answer my questions when I had trouble. I'm still not sure I understand everything I did today. My stuff works, but I need to make sure I understand exactly why it works. I enjoyed it more than I expected I would. When I came home I watched "This Old House" and really enjoyed it. At the moment I feel like I want to learn how to make and fix all kinds of stuff. I hope this feeling continues.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8287986-109494826245372336?l=dypcomjournal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dypcomjournal.blogspot.com/feeds/109494826245372336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8287986&amp;postID=109494826245372336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109494826245372336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8287986/posts/default/109494826245372336'/><link rel='alternate' type='text/html' href='http://dypcomjournal.blogspot.com/2004/09/lab-assignment-basic-electronics.html' title='Lab assignment: Basic Electronics'/><author><name>davidyates</name><uri>http://www.blogger.com/profile/02947603490134778311</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>
