Over the weekend I decided that my final project for the Introduction to Physical Computing class would be a cat toy. I have wanted to design cat toys and furniture since before I came to ITP; I will even admit that I am a cat video offender. Nonetheless, this is the perfect opportunity for me to stop talking about wanting to create a cat toy and start actually doing it.
To start off the design process I did a bit of research regarding cat toys, focusing my attention on any interactive electronic offering I could find. I started off by looking at several previous projects from ITP, then I looked at commercial toys. Here is an overview of what I found:
Previous Cat Toys from ITP
The Hanimustv by Aram Chang
The Hanimustv is a cat toy that was developed as a thesis project for last year. It is a “peek” and “hide” game that is controlled by a small remote control with arcade-style buttons. Small wooden cylinders are raised out of a box in response to button presses on the remote. The cylinders return to their original position once the button is released.
From a technology perspective, this cool toy uses an Arduino connected to buttons that controls a set of solenoids, which move the cylinders. Check out this cool user test video - the users testing the toy were of course cats, rather than humans.
Toy characteristics:
- Interactivity between cat and human
- Movement of physical objects for cat
- Physical controls for human
The Meowzer by Gordie and Emily
Another ITP cat toy that I discovered is called Meowzer; it was developed last spring semester by Gordie and Emily. Meowzer has a rotating top part that holds five arms. Four of these arms have dangling strings that hold small fluffy cat toys (one of which has a laser light). The fifth arm holds a small bunch of feathers and is the only one that can move up and down. The toy is controlled by an application that runs on a laptop computer.
From a technology perspective, this toy uses an Arduino that is connected to the following main components: DC motor that rotates the top part; Servo motor that moves the fifth arm up and down; and a laser light attached to one of the cat toys, in the mouth position. The application that controls the toy was developed in Processing.
Here is a link to the documentation about this project from Gordie’s blog. The documentation is comprehensive and features a nice video of the finished product.
Toy characteristics:
- Interactivity between cat and human
- Movement of physical objects and light for cat
- Virtual controls for human
Unnamed Toy by Patrick Proctor
The last ITP-developed cat toy that I found was developed by Patrick Proctor for our Introduction to Physical Computing class. This toy was designed to enable two cats to interact. It essentially features two separate toys that are connected. The first toy is a tennis ball on a metal spring that is secured to a wooden base; the cat plays with it by batting the ball around. The second toy is a laser pointer that moves from side to side; the cat plays with it by following the laser light reflection on walls. The movement of the laser pointer is partially governed by interactions with the tennis ball.
Here is a link to a blog post from Patrick where you can find pictures and an overview of his project.
Toy characteristics:
- Interactivity between cat and cat
- Movement of physical objects and light
- Physical controls for cat (or human)
Consumer Cat Toy Examples
Here I will focus my exploration on electronic cat toys only. That is not to say that old-school cat toys (such as plush toys, scratching pads, crinkly balls, laser pointers, shoe laces, etc) will not serve as part of my inspiration for this project. Ultimately, I want to create an electronic cat toy that rivals the interactivity provided by a stick with a piece of shoelace tied at the end, which to this day remains Sasha’s favorite toy.
Run Rascal
This is the only cat toy from the bunch that I have personally owned. It is a remote controlled mouse. My cat, Sasha, liked this toy well enough. The only problem we encountered was that the mouse is not able to run on carpets, which is where sasha likes to hang out the most. It is definitely the most interactive electronic cat toy that I have seen on the market.
Toy characteristics:
- Interactivity between cat and human
- Movement of physical object for cat
- Physical controls for human
The electronic toys listed below offer minimal or no interactivity. That is not to say that they are not much enjoyed by cats.
FroliCat Bolt
This is a relatively new cat toy that is relatively simple. It amounts to a laser light mounted in a well thought out container that moves the laser around a room. The laser moves based on the movement of a reflective mirror, rather than the movement of the light source itself. This toy offers an interesting mechanism, though it is not truly interactive (unless you hold it in your hand and use it like a traditional laser pointer).
Toy Characteristics:
- Movement of light for cat
- Limited interactivity provided
Mouse in the House
This is a cat toy that looks like a small diorama of a living room and features a track on which small toy mouse runs. The timing of the appearance of the small mouse can be programmed to enable the toy to entertain unattended cats for long periods of time. For the most part the toy seems to appeal to cats, though pet owners complain about the loud noise of the motor. Though this toy does not provide direct interactivity, it does offer the toy owner the ability to program the frequency of the mouse movement.
Toy Characteristics:
- Movement of physical object for cat
- Limited interactivity provided
Showing posts sorted by relevance for query ITP. Sort by date Show all posts
Showing posts sorted by relevance for query ITP. Sort by date Show all posts
Wednesday, November 11, 2009
Wednesday, September 9, 2009
Let the fun (and pain) begin
It's time for the fun to begin because summer vacation is officially over. I know this sounds counterintuitive, for most of my life I dreaded the end of vacation. This year, however, the end of summer coincides with the beginning of my studies at the Interactive Telecommunications Program.
This new beginning is an important culmination of my efforts to forge a new, and more creative, professional path, and my desire to play an active role in guiding the evolution and design of technology to a more human place.
On a practical level, I will be spending my days building prototypes and tinkering with code rather than strategizing on how to create desire in order to generate sales of products people don't need (my jaded marketing professional background coming out in full force). Of equal importance, I will have the opportunity to collaborate with a bunch of intelligent people who share a passion for technology, creativity, and exploration. The highlight of this first week has been to meet all of this diverse group of individuals. Here is brief overview of the background of the first year students at ITP:
Country of Origin:
Professional and academic backgrounds include:
As far as this journal is concerned I will be posting more frequently than ever. This will continue to be the place where I will share my experiences, ideas and projects related to the intersection of technology, design, and culture. To facilitate access to relevant content/topics I will organize my posts using course and topic tags. Here is a list of the course tags for the Fall 2009 semester:
This new beginning is an important culmination of my efforts to forge a new, and more creative, professional path, and my desire to play an active role in guiding the evolution and design of technology to a more human place.
On a practical level, I will be spending my days building prototypes and tinkering with code rather than strategizing on how to create desire in order to generate sales of products people don't need (my jaded marketing professional background coming out in full force). Of equal importance, I will have the opportunity to collaborate with a bunch of intelligent people who share a passion for technology, creativity, and exploration. The highlight of this first week has been to meet all of this diverse group of individuals. Here is brief overview of the background of the first year students at ITP:
Country of Origin:
- Brazil
- Canada
- Chile
- China
- Denmark
- England
- Germany
- Greece
- Indonesia
- Israel
- Japan
- South Korea
- Malaysia
- Mexico
- Taiwan
- Turkey
- USA
Professional and academic backgrounds include:
- Architecture
- Dance
- Illustration
- Music
- New media
- Sculpture
- Video
- Animation
- Math
- Fashion Design
- Business
- Non-Profit work
- Theatre
- Industrial Design
- Interior design
- Communications
- Film
- journalism
- Writing
- Engineering
- Photography
- Calligraphy
- Creative writing
As far as this journal is concerned I will be posting more frequently than ever. This will continue to be the place where I will share my experiences, ideas and projects related to the intersection of technology, design, and culture. To facilitate access to relevant content/topics I will organize my posts using course and topic tags. Here is a list of the course tags for the Fall 2009 semester:
- Introduction to Physical Computing: ITP-IntroPhysicalComp
- Introduction to Computational Media: ITP- IntroCompMedia
- Comm Lab: ITP-CommLab
- Applications of Interactive Telecommunications Technologies: ITP-ApplicationsITT
Friday, May 15, 2009
Statement of Purpose for ITP
I am excited for this opportunity to share with you more about what I am up to. Below I have posted the statement of purpose that I submitted with my application to the Interactive Telecommunications Program at NYU.
Writing this piece was difficult and cathartic. It required that I take a long and hard look at the reasons why I am pursuing this goal, and do a good bit of soul searching to identify which questions I want to explore in this program. This process forced me to start to crystalize what I want to create through my involvement at ITP. At the end of it all, I was more excited and energized than ever to pursue this path.
Over the next two years I will work to bring into existence many of the possibilities that I discuss in this piece. I look forward to sharing my experiences while on this journey, both the successes and failures. Not to mention that I'm sure I'll need guinea pigs from time to time. My only request in sharing this with you is that you feel free to share your own thoughts and ideas in return.
Statement of Purpose
"I’ve cultivated a passion for design and technology since I was teenager. My interest in design has inspired me to undertake numerous personal projects spanning industrial, graphic, web, and sound design, while my passion for technology has supplied valuable tools that have supported my projects and opened doors to new experiences. The increasingly pervasive role that technology plays in my life has given me a deeper understanding of the ways in which people engage with technology. As users of technology, we constantly shift between acting “through” it, as a tool, and acting “on” it, as an object of engagement itself.
I have become fascinated with the possibility of combining these passions in a new configuration: acting “through” design in order to act “on” technology. It is evident to me that the Interactive Telecommunications Program at New York University is the right place for me to explore this convergence of design and technology.
My interest in harnessing the power of design to enhance technology is not for technology’s own sake. It is driven by a belief that technology can have positive and negative consequences. Designers have an important role to play in shaping the evolution of technology by appropriately designing our interactions with, and through, technology.
On a personal level, I am inspired by the power of technology to enable connections between people, and to communicate meaning in engaging new ways. My iPhone has revolutionized the way I stay connected to people, content and places, and has also altered my expectations regarding their accessibility. The Nintendo Wii, by designing interactions that mimic the familiar gestures we use to do things in the physical world, enabled me to connect with friends who had no previous interest in video games.
The power of technology is ever more defined by its ability to connect people to other people, communities, and organizations. As a marketing communications professional I have realized that people have become empowered by technology to challenge the control once held by corporations over distribution of information. Traditional marketing communications now compete with the voices of millions of individuals, who on an aggregate level have a higher degree of credibility. At the same time, the connective power of technology has enabled the fragmentation of society into distinct communities that subscribe to different beliefs and value systems.
These are some of the realizations that have sparked my desire to experiment with design of technology-based interactions and experiences. My pursuit of this goal is driven by passion, curiosity, discipline, and integrity.
I designed a three-year plan and curriculum to channel my passion and curiosity in a disciplined manner. The first phase, currently in progress, is focused on building a theoretical foundation of knowledge through consumption and production of content that supports the development of an analytical design-perspective. The second phase concentrates on development of design production skills using a project-based approach that provides opportunities for learning through practice. The curriculum will then culminate with a focus on creativity driven by an integration of my analytical and production skills through continuous theoretical and hands-on engagement.
I have used similar strategies to achieve other important personal goals. When I moved to New York City in January of 1999, I created a similar plan to pursue DJing. After three years I was transformed from having no knowledge of how to spin records to moonlighting as a DJ with bi-weekly residences at popular parties in downtown lounges and clubs.
These pursuits have other important features in common: a genuine desire to share something of great personal value, and a focus on integrity. Sharing the joy and energy that music brought to my life was key to my success as a DJ. Acting with integrity also contributed to my accomplishments, though until recently I failed to notice that my actions did not support this same goal at a community level. I’ve realized that acting with integrity includes not only standing by my own promises. It also requires holding others accountable for their commitments. I failed to notice that I had too often sacrificed my authenticity and honesty because I was afraid of hurting someone’s feelings or not being liked.
This failure undermined my ability to grow as a leader and to contribute to the growth of other individuals within my personal and professional communities. Now, while I still place emphasis on getting along with others, I am also conscious that my integrity depends on direct and honest communications.
My interest in human growth and development is one of my main inspirations for applying to ITP. Beyond investigating how to improve interfaces with machines, I want to explore how technology can enhance the way human beings experience the world. How can technology create constructive new ways for people to communicate? How can we guide its continued expansion into our physical and social worlds so that it has a positive impact on the way we conceive and communicate our identity and individuality? How can it help to transform our consciousness so we depend less on a conditioned response and become more actively engaged?
I also want to explore how technology can be made accessible to a greater number of people. How can we create new and more natural and delightful ways for human beings to interact with computational devices? How can we enable communities of people who have special needs such as illiteracy or disability to interact with computational devices?
I know that the Interactive Telecommunications Program at NYU would provide me with unrivaled opportunities to investigate these areas of interest. I am attracted by the program’s focus on hands-on experimentation and the self-directed project-based framework on which it is built. I have limited experience writing code and building physical computing devices, but I have passion and desire to learn, which is evidenced by the assortment of cell phones and computers I’ve collected for hacking.
I have already started down the path of interaction design, and I would consider it an honor if I could integrate studies at ITP into my journey. In return I am eager to dedicate my passion, energy, commitment, and contagious optimism to ensure the continued success of this program."
Writing this piece was difficult and cathartic. It required that I take a long and hard look at the reasons why I am pursuing this goal, and do a good bit of soul searching to identify which questions I want to explore in this program. This process forced me to start to crystalize what I want to create through my involvement at ITP. At the end of it all, I was more excited and energized than ever to pursue this path.
Over the next two years I will work to bring into existence many of the possibilities that I discuss in this piece. I look forward to sharing my experiences while on this journey, both the successes and failures. Not to mention that I'm sure I'll need guinea pigs from time to time. My only request in sharing this with you is that you feel free to share your own thoughts and ideas in return.
Statement of Purpose
"I’ve cultivated a passion for design and technology since I was teenager. My interest in design has inspired me to undertake numerous personal projects spanning industrial, graphic, web, and sound design, while my passion for technology has supplied valuable tools that have supported my projects and opened doors to new experiences. The increasingly pervasive role that technology plays in my life has given me a deeper understanding of the ways in which people engage with technology. As users of technology, we constantly shift between acting “through” it, as a tool, and acting “on” it, as an object of engagement itself.
I have become fascinated with the possibility of combining these passions in a new configuration: acting “through” design in order to act “on” technology. It is evident to me that the Interactive Telecommunications Program at New York University is the right place for me to explore this convergence of design and technology.
My interest in harnessing the power of design to enhance technology is not for technology’s own sake. It is driven by a belief that technology can have positive and negative consequences. Designers have an important role to play in shaping the evolution of technology by appropriately designing our interactions with, and through, technology.
On a personal level, I am inspired by the power of technology to enable connections between people, and to communicate meaning in engaging new ways. My iPhone has revolutionized the way I stay connected to people, content and places, and has also altered my expectations regarding their accessibility. The Nintendo Wii, by designing interactions that mimic the familiar gestures we use to do things in the physical world, enabled me to connect with friends who had no previous interest in video games.
The power of technology is ever more defined by its ability to connect people to other people, communities, and organizations. As a marketing communications professional I have realized that people have become empowered by technology to challenge the control once held by corporations over distribution of information. Traditional marketing communications now compete with the voices of millions of individuals, who on an aggregate level have a higher degree of credibility. At the same time, the connective power of technology has enabled the fragmentation of society into distinct communities that subscribe to different beliefs and value systems.
These are some of the realizations that have sparked my desire to experiment with design of technology-based interactions and experiences. My pursuit of this goal is driven by passion, curiosity, discipline, and integrity.
I designed a three-year plan and curriculum to channel my passion and curiosity in a disciplined manner. The first phase, currently in progress, is focused on building a theoretical foundation of knowledge through consumption and production of content that supports the development of an analytical design-perspective. The second phase concentrates on development of design production skills using a project-based approach that provides opportunities for learning through practice. The curriculum will then culminate with a focus on creativity driven by an integration of my analytical and production skills through continuous theoretical and hands-on engagement.
I have used similar strategies to achieve other important personal goals. When I moved to New York City in January of 1999, I created a similar plan to pursue DJing. After three years I was transformed from having no knowledge of how to spin records to moonlighting as a DJ with bi-weekly residences at popular parties in downtown lounges and clubs.
These pursuits have other important features in common: a genuine desire to share something of great personal value, and a focus on integrity. Sharing the joy and energy that music brought to my life was key to my success as a DJ. Acting with integrity also contributed to my accomplishments, though until recently I failed to notice that my actions did not support this same goal at a community level. I’ve realized that acting with integrity includes not only standing by my own promises. It also requires holding others accountable for their commitments. I failed to notice that I had too often sacrificed my authenticity and honesty because I was afraid of hurting someone’s feelings or not being liked.
This failure undermined my ability to grow as a leader and to contribute to the growth of other individuals within my personal and professional communities. Now, while I still place emphasis on getting along with others, I am also conscious that my integrity depends on direct and honest communications.
My interest in human growth and development is one of my main inspirations for applying to ITP. Beyond investigating how to improve interfaces with machines, I want to explore how technology can enhance the way human beings experience the world. How can technology create constructive new ways for people to communicate? How can we guide its continued expansion into our physical and social worlds so that it has a positive impact on the way we conceive and communicate our identity and individuality? How can it help to transform our consciousness so we depend less on a conditioned response and become more actively engaged?
I also want to explore how technology can be made accessible to a greater number of people. How can we create new and more natural and delightful ways for human beings to interact with computational devices? How can we enable communities of people who have special needs such as illiteracy or disability to interact with computational devices?
I know that the Interactive Telecommunications Program at NYU would provide me with unrivaled opportunities to investigate these areas of interest. I am attracted by the program’s focus on hands-on experimentation and the self-directed project-based framework on which it is built. I have limited experience writing code and building physical computing devices, but I have passion and desire to learn, which is evidenced by the assortment of cell phones and computers I’ve collected for hacking.
I have already started down the path of interaction design, and I would consider it an honor if I could integrate studies at ITP into my journey. In return I am eager to dedicate my passion, energy, commitment, and contagious optimism to ensure the continued success of this program."
Labels:
communication,
coupling,
experience,
interaction design,
ITP,
personal,
physical computing,
technology
Monday, May 11, 2009
Back to School at the Interactive Telecommunications Program at NYU
I'm going back to school. I am officially enrolled in the Interactive Telecommunications Program at the Tisch School of Arts at NYU. This is an extremely exciting and valuable opportunity for me. It is an ideal compliment to my personal interaction and experience design curriculum.
This program affords me the chance to develop practical know-how regarding how to create engaging and valuable experiences using communication technologies. My existing theory-based (know-that) knowledge, accumulated from much reading and writing during the past 8 months, should come in handy.
Here is a brief overview of what the program's mission (straight from their own website): "to explore the imaginative use of communications technologies — how they might augment, improve, and bring delight and art into people’s lives. Perhaps the best way to describe us is as a Center for the Recently Possible."
This event has several implications for this blog. From a content perspective, I will begin to post information related to my ITP experience. All of these entries will be tagged with the label ITP . I will begin this series by posting my statement of purpose. Then I will share project ideas and questions I find worth exploring. I hope that this will help me refine my thoughts and ideas.
The last and most superficial impact of this event is a title change for this blog. I am currently planning to change form Learning Interaction and Experience Design to Technology/Culture/Design/Experience. This is officially the "acting" tile; which means that any day now it can be replaced by the actual title (if organizations can do this with their employees why can't organisms do the same with our own resources, such as blog titles).
That's all for tonight, I am suffering from a mild mental blockage (it took me over an hour to write this short post). I will have much more to say about ITP over the coming months.
This program affords me the chance to develop practical know-how regarding how to create engaging and valuable experiences using communication technologies. My existing theory-based (know-that) knowledge, accumulated from much reading and writing during the past 8 months, should come in handy.
Here is a brief overview of what the program's mission (straight from their own website): "to explore the imaginative use of communications technologies — how they might augment, improve, and bring delight and art into people’s lives. Perhaps the best way to describe us is as a Center for the Recently Possible."
This event has several implications for this blog. From a content perspective, I will begin to post information related to my ITP experience. All of these entries will be tagged with the label ITP . I will begin this series by posting my statement of purpose. Then I will share project ideas and questions I find worth exploring. I hope that this will help me refine my thoughts and ideas.
The last and most superficial impact of this event is a title change for this blog. I am currently planning to change form Learning Interaction and Experience Design to Technology/Culture/Design/Experience. This is officially the "acting" tile; which means that any day now it can be replaced by the actual title (if organizations can do this with their employees why can't organisms do the same with our own resources, such as blog titles).
That's all for tonight, I am suffering from a mild mental blockage (it took me over an hour to write this short post). I will have much more to say about ITP over the coming months.
Friday, July 31, 2009
Excitement Continues to Build for ITP
Preparations continue for the Interactive Telecommunications Program that I will be starting in September, and the excitement builds with every action I take. Earlier today I was checking the course descriptions and calendar for the fall 2009 semester, which have recently become available. During this process I felt giddy like a geeky kid in a high-tech toy store.
The focus of my activities today were on better acquainting myself with the core requirements that I will need to take in the first and second semesters. In college, these requirements are usually courses that people do not want to take but are required to because of a need to ensure that everyone receives a well-rounded education.
At ITP the foundation courses focus on building a basic understanding regarding the applications of interactive technologies, the use of computation as a medium, and skills required for programming software and building hardware. Below are brief overviews taken from the course descriptions of the four core requirements. I can't wait to get started.
This introductory class is designed to allow students to engage in a critical dialogue with leaders drawn from the artistic, non-profit and commercial sectors of the new media field, and to learn the value of collaborative projects by undertaking group presentations in response to issues raised by the guest speakers.
Introduction to Computational Media
What can computation add to human communication? Creating computer applications, instead of just using them, will give you a deeper understanding of the essential possibilities of computation. The course focuses on the fundamentals of programming the computer (variables, conditionals, iteration, functions, and objects) and then touches on some more advanced techniques such as text parsing, image processing, networking, computer vision, and serial communication.
Introduction to Physical Computing
This course expands the students' palette for physical interaction design with computational media. We look away from the limitations of the mouse, keyboard and monitor interface of today's computers, and start instead with the expressive capabilities of the human body. We consider uses of the computer for more than just information retrieval and processing, and at locations other than the home or the office.
Comm Lab
An introductory course designed to provide students with hands-on experience using various technologies including social software and web development, digital imaging, audio, video and animation. The forms and uses of new communications technologies are explored in a laboratory context of experimentation and discussion.
Friday, November 6, 2009
ICM Class Notes - Using PHP - November 5, 2009
In today’s ICM class we reviewed basic concepts associated to PHP, and discussed when to use PHP (as a stand alone solution, or in conjunction with Processing).
PHP – Hypertext Pre-Processor Language
PHP was designed for server-side scripting – for development of applications that run on servers. In contrast, Processing (and Java on which it is built) was developed for client side applications – for development of programs that run on client-side computers. Originally designed to serve dynamic web content. In short, PHP enables us to store and capture information from a server more effectively and efficiently than Processing.
Here is an example of an application where PHP is used to store data for a Processing sketch. This code was written by Dan Shiffman, my professor at ITP, and it features a shared white board, where users can add new coordinates that can be viewed by all other users (anyone can also clear the board). PHP can also be used to develop a multi-user high score feature for a game developed in Processing.
How to Run PHP?
In order to run PHP you need a server or computer that is properly set-up. Most web servers support PHP, though the ones that are based on Microsoft solutions tend not to. That said, even servers that support PHP need to be properly set-up. Luckily for us, the ITP server is already set up for PHP. Many desktop and laptop computers can also be set-up to run PHP scripts.
PHP code is usually embedded in HTML documents. To embed PHP code into an HTML document the following identifiers are used: “” ends a code block. It is important to note that PHP code will not be present on the HTML source available via web browers. The reason being, the PHP code on the server is used to dynamically generate the HTML code that is sent to your computer, and viewable as source.
The Basic Elements of Coding – PHP Style
The basic concepts associated to PHP coding are similar to those used in Processing. PHP is an object-oriented language that features all of the same attributes: variables, conditionals, loops, functions, classes, etc. Here is a quick overview of some basic similarities and differences between these two tools.
Primitive Variables
All variables in PHP need to be defined/initiated by being assigned a value. To identify a variable the variable name needs to be preceded by the “$” character. However, unlike Processing, PHP does not require or support the typing of variables. This is a more flexible approach than Processing but it also opens the doors to more mistakes not being caught by the compiler.
Example variable definition code: “$ x = 5;”
Arrays
To make an array in PHP you just assign an “array(arrayElements)” to any variable name. As with primitive variables, there is no need to define the array type. To add elements to an array is simple simpler than in Processing, as shown below. It is important to note a PHP array can also hold different types of data.
- Creating an array: “$arraySample = array(0,1,2,3);”
- Adding an element to an array: “$arraySample[] = 5;”
PHP also supports associative arrays as well. These arrays indentify each data element by a name as opposed to an index number. These arrays can be used in interesting ways. They are available in Processing through Java.
- Using an associative array: “$arraySample[“fred”] = 50;”
Conditionals and Loops
The syntax for loops and conditional statements is identical to that found in Processing.
Functions and OOP in PHP
In PHP to define a function it name needs to be preceded by the identifier “function”. Similar to variables definitions, functions are not typed. Class definitions feature the same overall structure, though the constructor name is identified as “function _constructor()”. When working with instances of objects the “->” in PHP replaces the “.” in Processing.
Query Strings
Query string refers to HTML urls that reference PHP scripts and contain information that can be processed by the PHP script to dynamically generate content (HTML or other text-based documents). Since PHP primarily runs on web servers, this is the main way in which information is passed to PHP scripts. Here is an example where the identifier “name” contains data element “Julio”, “nationality” contains “brazil”, and “residence” contains “nyc”.
“http://……sample.php?name=Julio&nationality=brazil&residence=nyc”
Online, these query strings are most often used to transmit data captured from users via a web forms. Processing applications can generate query scripts that both request data and initiate other activities on the server side.
Reading Query Strings
To read values from query strings an associative array is used. PHP creates an associative array that pairs each identifier from the query string (which is always consistent) with a data element (which is variable). This array is called $_GET. Here is a sample line of code to read my name from the query string above into the variable $name:
“$name =$_GET[“name”];”
PHP Resources
Miscellaneous
- Dan shared with us Coda, a development environment that enables programmers to access and edit PHP and HTML files on the server. Coda is a text editor and ftp application combined in one.
- In today’s class we got to see Josh K’s project, a sketch that generates a line that evolves in a 3D space using the principles of Perlin noise. It is a great looking visual, unfortunately, he has not yet posted the sketch online.
Monday, November 9, 2009
Comm Lab Video Project - Storyboard Development
Earlier today I worked with Arturo, Eric, and Tamar to develop the concept and storyboards for our Communication Lab class. We met up this morning at eleven in a coffee shop near the ITP floor. After brainstorming for 30 minutes we created a long list of possible inspirations for our story. Here is a link to a more readable version of this document.
After developing this list we identified a few main themes and explored many different storylines. We settled on the idea of creating a video that captures a news program host going ballistic. We were loosely inspired by Bill O'Reilly's famous freakout - I can't believe that I am admitting to being inspired by Mr. O'Reilly.
After developing the general arch of the story we headed back to the ITP floor to collaboratively draw the storyboards on the large rolls of paper from the studio. Here is a picture of our finished work (follow this link to view a more readable version).
After developing this list we identified a few main themes and explored many different storylines. We settled on the idea of creating a video that captures a news program host going ballistic. We were loosely inspired by Bill O'Reilly's famous freakout - I can't believe that I am admitting to being inspired by Mr. O'Reilly.
After developing the general arch of the story we headed back to the ITP floor to collaboratively draw the storyboards on the large rolls of paper from the studio. Here is a picture of our finished work (follow this link to view a more readable version).
Wednesday, September 16, 2009
Comm Lab - 1st Class
Earlier this week we held our first Comm Lab class, led by Marianne Petit. Comm Lab is one of the foundational courses at ITP. If focuses on providing a theoretical introduction to, and hands on experience with, using a variety of tools for communication and story telling. In this class we will explore the use of blogging, social networks, comics, animations, sounds, video, imaging, and other media technologies. During this first session we reviewed the course syllabus and reviewing the process for setting up a WordPress blog.
The course is structured as follows: Mandatory weekly readings (reading list featured below) are coupled with class discussions to provide the theoretical underpinnings for the course. Collaborative and individual exercises are assigned on a weekly-basis to provide practical experience and know-how. Documentation of these explorations and readings is a key part of the course, serving as a foundation for developing strong skills and knowledge in this arena.
Required readings: Orality and Literacy by Walter Ong, Understanding Media by Marshall Mcluhan, Understanding Comics by Scott McCloud;
Recommended readings: Film Directing Shot by Shot by Steven Katz, Digital Foundations: Introduction to Media Design with the Adobe Creative Suite by Michael Mandiberg.
For this week our main assignment is to install the WordPress blog software on our partition of the ITP server. Here are the step by step directions for accomplishing this task. We are also tasked with reading the first four chapters from Walter Ong's book and posting a response on our newly set-up blogs. On a personal level, I am going to use this opportunity to test out the WordPress platform to determine whether I want to transfer all of my blogs from Blogger, where they currently reside.
The course is structured as follows: Mandatory weekly readings (reading list featured below) are coupled with class discussions to provide the theoretical underpinnings for the course. Collaborative and individual exercises are assigned on a weekly-basis to provide practical experience and know-how. Documentation of these explorations and readings is a key part of the course, serving as a foundation for developing strong skills and knowledge in this arena.
Required readings: Orality and Literacy by Walter Ong, Understanding Media by Marshall Mcluhan, Understanding Comics by Scott McCloud;
Recommended readings: Film Directing Shot by Shot by Steven Katz, Digital Foundations: Introduction to Media Design with the Adobe Creative Suite by Michael Mandiberg.
For this week our main assignment is to install the WordPress blog software on our partition of the ITP server. Here are the step by step directions for accomplishing this task. We are also tasked with reading the first four chapters from Walter Ong's book and posting a response on our newly set-up blogs. On a personal level, I am going to use this opportunity to test out the WordPress platform to determine whether I want to transfer all of my blogs from Blogger, where they currently reside.
Friday, October 30, 2009
Media Controller Project (and ICM Mid Term) - Phase 3
During that last several days I have been working on setting up a Processing sketch that can work with my Physical Computing media controller and serve as my mid-term project for the Introduction to Computational Media course. Long before arriving at ITP I have been interested in the design and development of media controllers. This project provided the opportunity for me to start some hands-on explorations.
In my previous post I already discussed the process for choosing the solution for playing and controlling our audio – we have decided to use Processing (and the Arduino) to control Ableton Live. Today I will provide an overview of how I developed the code for this application and some of the interface considerations associated to designing a software that could work across physical and screen-based interfaces.
My longer term objective is to create MIDI controllers using for audio and video applications using touchscreen and gestural interfaces. The interfaces that I am designing would ideally be evolved to work on multi-touch surfaces. In regards to my interest in gestural interaction, this I hope to explore through my current physical computing project and future projects.
Developing the Sketches
Since the physical computing project requires three basic types of controls that are the foundation of the media interface for my computational media mid-term, I decide to start with a focus on writing the code for these three basic elements. I set out to create code that could be easily re-used so that I could add additional elements with little effort. Here is a link to the sketch on openprocessing.org, where you can also view the full code for the controller pictured below (v1.0).
The process I used to create these sketches included the following steps: (1) creating the functionality associated to each element, separately; (2) creating a class for each element; (3) integrating objects of each class in Processing; (4) testing Processing with OSCulator and Ableton; (5) creating the Serial protocol to communicate the Arduino; (6) testing the sensors; (7) writing the final code for the Arduino; (8) testing Serial connection to Arduino; (9) calibration of the physical computing interface (whenever and wherever we set it up).
I have already made two posts on this subject (go to phase 1 post, go to phase 2 post), however, today I can attest that I have completed the vast majority of the work. The last processing sketch that I shared featured a mostly completed Matrix object that included functions for OSC communication. The serial communication protocol had also been defined.
The many additions to the sketch include creation of button and slider elements (each in its own class), a control panel (that holds the buttons and sliders), and a version of the application that features multiple button and sliders. The main updates to existing features include changes to Serial communication protocol to support additional sliders and matrices), and OSC communication code updates to ensure that messages are only sent when values change rather than continuously.
For the slider object I used the mouseDrag() function for the very first time. I had to debug my code for a while to get the visual slider to work properly. The button was easy to code from a visual perspective. The challenge I faced was in structuring the OSC messages so that I was able to send two separate and opposing messages for each click. The reason why this is important is that Ableton Live uses a separate buttons for starting and stopping clips. So I had to find a way to enable a single button to perform both functions.
The serial communication protocol update was easy to implement, so I will not delve into it here. To change the OSC communication protocol required a bit more work. I created a previous state variable in each object class to be enable verification of whether a change had occurred. The logic was implemented an “if” statement in the OSC message function.
Evolving the Controller
Here is an overview of my plans associated to this project: I plan to expand the current media controller with a few effect grids and the ability to select individual channels to apply effects. In order to do this I have to create new functions for the matrix class that enables me to set the X and Y matrix map values. I also want to work on improving the overall esthetics of the interface (while keeping its minimal feel).
From a sketch-architecture perspective I am considering creating a parent class for all buttons, grids and sliders. It would feature attributes and functionality that is common amongst all elements. Common attributes include location, size and color; common functionality requirements include detection of mouse location relative to object, OSC communication.
Questions for Class
Here is a question that came up during my development of this sketch (Dan, I need your help here). Can I use the translate, pop and pushMatrix commands to just to capture the current mouse location? This would be an easier solution to checking whether the mouse was hovering over an object.
In my previous post I already discussed the process for choosing the solution for playing and controlling our audio – we have decided to use Processing (and the Arduino) to control Ableton Live. Today I will provide an overview of how I developed the code for this application and some of the interface considerations associated to designing a software that could work across physical and screen-based interfaces.
My longer term objective is to create MIDI controllers using for audio and video applications using touchscreen and gestural interfaces. The interfaces that I am designing would ideally be evolved to work on multi-touch surfaces. In regards to my interest in gestural interaction, this I hope to explore through my current physical computing project and future projects.
Developing the Sketches
Since the physical computing project requires three basic types of controls that are the foundation of the media interface for my computational media mid-term, I decide to start with a focus on writing the code for these three basic elements. I set out to create code that could be easily re-used so that I could add additional elements with little effort. Here is a link to the sketch on openprocessing.org, where you can also view the full code for the controller pictured below (v1.0).
The process I used to create these sketches included the following steps: (1) creating the functionality associated to each element, separately; (2) creating a class for each element; (3) integrating objects of each class in Processing; (4) testing Processing with OSCulator and Ableton; (5) creating the Serial protocol to communicate the Arduino; (6) testing the sensors; (7) writing the final code for the Arduino; (8) testing Serial connection to Arduino; (9) calibration of the physical computing interface (whenever and wherever we set it up).
I have already made two posts on this subject (go to phase 1 post, go to phase 2 post), however, today I can attest that I have completed the vast majority of the work. The last processing sketch that I shared featured a mostly completed Matrix object that included functions for OSC communication. The serial communication protocol had also been defined.
The many additions to the sketch include creation of button and slider elements (each in its own class), a control panel (that holds the buttons and sliders), and a version of the application that features multiple button and sliders. The main updates to existing features include changes to Serial communication protocol to support additional sliders and matrices), and OSC communication code updates to ensure that messages are only sent when values change rather than continuously.
For the slider object I used the mouseDrag() function for the very first time. I had to debug my code for a while to get the visual slider to work properly. The button was easy to code from a visual perspective. The challenge I faced was in structuring the OSC messages so that I was able to send two separate and opposing messages for each click. The reason why this is important is that Ableton Live uses a separate buttons for starting and stopping clips. So I had to find a way to enable a single button to perform both functions.
The serial communication protocol update was easy to implement, so I will not delve into it here. To change the OSC communication protocol required a bit more work. I created a previous state variable in each object class to be enable verification of whether a change had occurred. The logic was implemented an “if” statement in the OSC message function.
Evolving the Controller
Here is an overview of my plans associated to this project: I plan to expand the current media controller with a few effect grids and the ability to select individual channels to apply effects. In order to do this I have to create new functions for the matrix class that enables me to set the X and Y matrix map values. I also want to work on improving the overall esthetics of the interface (while keeping its minimal feel).
From a sketch-architecture perspective I am considering creating a parent class for all buttons, grids and sliders. It would feature attributes and functionality that is common amongst all elements. Common attributes include location, size and color; common functionality requirements include detection of mouse location relative to object, OSC communication.
Questions for Class
Here is a question that came up during my development of this sketch (Dan, I need your help here). Can I use the translate, pop and pushMatrix commands to just to capture the current mouse location? This would be an easier solution to checking whether the mouse was hovering over an object.
Monday, September 28, 2009
Thoughts on The Machine Stops by E.M. Forster
I thoroughly enjoyed the short story The Machine Stops, by E.M. Forster. This tale tells the story about a future world where everyone lives a life secluded in private cells, all communications are mediated through a machine, all human needs are satisfied through this same machine, and first-hand experience of anything and everything is frowned down upon. Similar to the world depicted in Orwell's classic 1984, humans in this world live like slaves though most choose not to recognize this reality.
The main sentiment Forster echoes in this short story is the fear that through technology we may loose our humanity (or in other word, technology may ultimately dehumanize our society). In The Machine Stops, the machine, rather than man, has become the measure for all things. Human beings have been relegated to lives without any direct contact with nature or one another. Original thought and experience are looked down upon, since they are not confined to the conventions upon which the machine is built.
Before I delve any further into Forster's story, it is important for me to define what I think he means by technology. In one of my classes at ITP someone posited that we (as in humans) considered technology to be anything that was developed after we passed our early teenage years. Though this explanation is practical when talking to a younger person about devices such as computers and cellphones, it is not nearly broad enough. Technology ultimately refers to the making of things - that is why written language is a technology and so is religion, democracy, the wheel, man-made fire, books, bicycles, and of course iPhones.
One very interesting, and prescient element, about this story is how humans choose to imprison themselves by this machine of their own making. This contrasts with many more modern sci-fi stories - e.g. terminator and the matrix - where the machines gain consciousness and rise up against humans. This idea of humans choosing to imprison themselves is fascinating, especially when you view the many layers of technology through which we already mediate our experience of the world.
It brings to my mind how even the technology of language, especially when complemented by writing, often functions as lens through which humans experience the world rather than a set of tools to describe our experiences. As pointed out in Ong's reading from last week, the birth of written language gave rise to much fear (as has the rise of computers in our modern age). In the end it was ironic how the people who were best able to verbalize their fearful emotions about the new technology of written language, embraced written language in their attempts to make cases against it.
The many conventions that we have created in language and that govern our experience of the world were mostly developed in response to one person's (or many people's) experience from a long time ago. The problem is that these conventions often remain in place long after the context in which they were created has vanished. Worst yet, these conventions are often held as truths that supersede a person's conflicting direct experience of the world.
In the world created by Forster, technology is in many ways a dead relic from the past that keeps us from experiencing directly the world in which we are living right now. In his book Zen and the Art of Motorcycle Maintenance, Robert M. Pirsig offers another interesting perspective on technology, and our discontents with it: the source of our discontent with technology in Western society is caused by the dualistic thought that dominates our society. "The way to solve the conflict between human values and technological needs is not to run away from technology. That's impossible. The way to resolve the conflict is to break down the barriers of dualistic thought that prevent a real understanding of what technology is-a fusion of nature and the human spirit into a new kind of creation that transcends both." (p. 284).
As such, the problem with the technological progress in Western society, and the feeling of estrangement caused by it, could be ascribed to our focus on rational and considerations and subject-object dualism (the machine-side of man) and disregard for emotional considerations and a holistic understandings, which cannot be verified analytically.
Saturday, December 26, 2009
Creating a Collaborative Storytelling Experience
As luck would have it, I was assigned to present in Red's Application class during the last week of school. Needless to say, I was dreading having to juggles multiple final projects with this important assignment. This anxiety was only heightened by the stories of suffering from many of the groups that preceded us.
Now that I have lived through this insanely busy time I am happy to report that I thoroughly enjoyed working on this project. It gave me a chance to collaborate with an awesome group of people, we were provided with the opportunity to respond to a very interesting speaker, and we were able to create a fun and collaborative way to end of semester.
Our task was to create a response to Jake Barton's presentation, which focused on collaborative storytelling installations and projects. Here is a link to my detailed notes from this class. To get started working on the presentation we met right after Jake's presentation. We quickly settled on a general direction - creating a collaborative experience that engaged the entire class in a storytelling exercise.
Development and Execution of Installation
After meeting with Todd and holding some additional brainstorm sessions, we decided to focus our response on creating a platform for first-year students to contribute their ITP stories for the development of a meta-narrative. After additional discussions we decided to keep things low-tech, and to limit the activities to the time and physical space of the class itself (we did not want to give other student's "homework" during finals).
The design of our installation was focused around a physical timeline, to which students would add their own stories using stickies or by drawing directly onto the surface itself. To inspire our peers we added a few initial elements to the timeline and we created a video featuring work from first-year students developed throughout the semester. Below you will find a short video overview of our development process, along with the video we developed for the event itself, and some pictures from the event.
Video Featuring Work from 1st Year Students
Pictures from Collaborative Storytelling Event
Now that I have lived through this insanely busy time I am happy to report that I thoroughly enjoyed working on this project. It gave me a chance to collaborate with an awesome group of people, we were provided with the opportunity to respond to a very interesting speaker, and we were able to create a fun and collaborative way to end of semester.
Our task was to create a response to Jake Barton's presentation, which focused on collaborative storytelling installations and projects. Here is a link to my detailed notes from this class. To get started working on the presentation we met right after Jake's presentation. We quickly settled on a general direction - creating a collaborative experience that engaged the entire class in a storytelling exercise.
Development and Execution of Installation
After meeting with Todd and holding some additional brainstorm sessions, we decided to focus our response on creating a platform for first-year students to contribute their ITP stories for the development of a meta-narrative. After additional discussions we decided to keep things low-tech, and to limit the activities to the time and physical space of the class itself (we did not want to give other student's "homework" during finals).
The design of our installation was focused around a physical timeline, to which students would add their own stories using stickies or by drawing directly onto the surface itself. To inspire our peers we added a few initial elements to the timeline and we created a video featuring work from first-year students developed throughout the semester. Below you will find a short video overview of our development process, along with the video we developed for the event itself, and some pictures from the event.
Video Featuring Work from 1st Year Students
Pictures from Collaborative Storytelling Event
Thursday, December 10, 2009
Creating Movement for the Cat Toy
Over the past couple of days I have struggled in my attempts to set up a stepper motor. Late last week my struggle continued as I tried to set-up three new stepper motors that I received for the cat that I am building. Having come home defeated I decided that the best course of action was for me to do some research regarding how stepper motors work so that I can improve my understanding and conceptual model of this component.
In the last hour I have discovered two really good overviews of how steppers work. The first is Mike Cook’s overview on his instructional blog; this is the second time that I link to Mike’s blog, he has a lot of great content for beginner's like me. This tutorial helped me finally understand how the coils are arranged and organized within the motor and how the stepping sequence is able to move the motor rotor through different positions. In retrospect it all seems obvious.
Another website that has content that is worth checking out is stepperworld.com. The tutorial here does not provide as thorough an overview of the inner workings of stepper motors. However, it does a better job at providing guidance for figuring out the proper wiring sequence of a stepper motor.
So what the hell did I learn about the topics mentioned above? Here is a brief overview but for more in-depth information check out the two links above.
Structure of the coils inside the motor
The coils in stepper motors are wrapped around a structure that surrounds the rotor. The number of times that the coils are wrapped around the rotor determines the number of steps required for the motor to make one full rotation. For example if the coils are wrapped around 48 times, then the motor would take 48 steps to complete one full rotation. Here is an image from Mike Cook’s site that illustrates this design.
To move the motor the coils are energized in sequence. Motors can be used in two different modes: full-step and half-step. When two coils are energized at any given time the motor moves in full step, which provides greater torque but less precision. When the motor is energized one coil at a time it provides greater precision of movement (twice the number of steps per rotation) but less torque. Here is another image from Mike's blog that demonstrates how full-step movement works.
Now that I understood how stepper motors work, I had to figure out the proper step and wiring sequence to get the motor to work properly. I started by re-checking all wire connections to ensure that I attached the leads from the motors to the appropriate control pins (via the transistors) and power source pins. This was a good thing because I realized that I had attached one of the power wires to a control pin.
Once I the wiring was set-up properly I was still experiencing issues with the stepper motors. They would turn on and spin for 10 to 20 seconds, then they would stop working. I met with Xiaoyang, one of ITP's residents, regarding this issue. He recommended that I test the power source voltage and amperage. The motor’s rating is 5 volts at 1 amp. Based on Xioayang’s advice and my research online, I decided that I needed to find a power source that delivered twice the current required by the motor.
I purchased a 2 amp transformer from Radio Shack that can be set to output between 3v to 7v. It is a great little tool, and it brought my motors to life! I was dancing around the table when this happened. It seems like I may actually be able to bring my cat toy to life. My next challenge was getting multiple motors to run smoothly together smoothly. The code samples that I've found and the stepper motor library are not appropriate for controlling multiple motors - more on this on my next post on this subject.
In the last hour I have discovered two really good overviews of how steppers work. The first is Mike Cook’s overview on his instructional blog; this is the second time that I link to Mike’s blog, he has a lot of great content for beginner's like me. This tutorial helped me finally understand how the coils are arranged and organized within the motor and how the stepping sequence is able to move the motor rotor through different positions. In retrospect it all seems obvious.
Another website that has content that is worth checking out is stepperworld.com. The tutorial here does not provide as thorough an overview of the inner workings of stepper motors. However, it does a better job at providing guidance for figuring out the proper wiring sequence of a stepper motor.
So what the hell did I learn about the topics mentioned above? Here is a brief overview but for more in-depth information check out the two links above.
Structure of the coils inside the motor
The coils in stepper motors are wrapped around a structure that surrounds the rotor. The number of times that the coils are wrapped around the rotor determines the number of steps required for the motor to make one full rotation. For example if the coils are wrapped around 48 times, then the motor would take 48 steps to complete one full rotation. Here is an image from Mike Cook’s site that illustrates this design.To move the motor the coils are energized in sequence. Motors can be used in two different modes: full-step and half-step. When two coils are energized at any given time the motor moves in full step, which provides greater torque but less precision. When the motor is energized one coil at a time it provides greater precision of movement (twice the number of steps per rotation) but less torque. Here is another image from Mike's blog that demonstrates how full-step movement works.
Now that I understood how stepper motors work, I had to figure out the proper step and wiring sequence to get the motor to work properly. I started by re-checking all wire connections to ensure that I attached the leads from the motors to the appropriate control pins (via the transistors) and power source pins. This was a good thing because I realized that I had attached one of the power wires to a control pin.
Once I the wiring was set-up properly I was still experiencing issues with the stepper motors. They would turn on and spin for 10 to 20 seconds, then they would stop working. I met with Xiaoyang, one of ITP's residents, regarding this issue. He recommended that I test the power source voltage and amperage. The motor’s rating is 5 volts at 1 amp. Based on Xioayang’s advice and my research online, I decided that I needed to find a power source that delivered twice the current required by the motor.
I purchased a 2 amp transformer from Radio Shack that can be set to output between 3v to 7v. It is a great little tool, and it brought my motors to life! I was dancing around the table when this happened. It seems like I may actually be able to bring my cat toy to life. My next challenge was getting multiple motors to run smoothly together smoothly. The code samples that I've found and the stepper motor library are not appropriate for controlling multiple motors - more on this on my next post on this subject.
[note: most of this post was written during last weekend on December 4th]
Tuesday, October 13, 2009
ICM Class Notes, Handling Strings - October 7, 2009
Topics covered during class:
While reviewing this week’s homework we came across the use of double arrays (I could not find documentation for these types of arrays on the processing website). These arrays store two dimensions of data in a matrix that can be visualized as a spreadsheet or grid (check out the fig. a below). These arrays are the basis for image and video processing since to the computer a display is nothing more than a two-dimensional array.

Another interesting type of array is the ArrayList. These are a special type of array that is dynamically allocated. What this means from a practical perspective is that you can add and remove elements while the program is running. An array lists is a more efficient solution than appending normal arrays. However, if you know how many elements you will need before run time, it is most efficient to use a standard array.
This power comes at a price, to use data from these arrays you need to create temporary local variables that are often not necessary when using regular arrays. An array list also has a different set of function than a normal array (even the ones that perform the same functions have different names,).
Displaying text information
During the second half of this week’s class we learned how to handle text - both how to display text and how to read text data from sources such as the Internet. I can’t wait to begin using these capabilities since data visualization is one of the areas that I hope to explore during my time at ITP. Let’s start with the basics and work our way up.
Definition of characters and strings:
On the other hand, createFont() enables to load a font at the moment the application is running. It also supports resizing of fonts without pixilation. However, if the person running the application does not have the selected font then the system defaults to an available font, which may look horrible with your design.
Capturing information from the Internet
For the most part, being able to take data from a website and using that data to impact a sketch takes a lot of detective work. The reason being you need to look at the source code from a website to understand how it is structured so that you can determine if there is a standard syntax that can enable your sketch to consistently find the information you want to capture. Here is an overview of the entire process
1. In practice this first step involves looking for identifiers within HTML/XML code that precede and follow the golden nugget of information you seek. It is always easier to use XML feeds than HTML code (and firefox is better to investigate XML than Safari). If using XML code you should leverage processing’s XML library. Once you have found the source on the internet from which you want to import data go to the next step.
2. Load the page into processing as a string using the loadStrings(URL) function. This method loads the document into an array of strings, each line is put into a separate element in the array. This means that when we are declaring a variable to import a text document we need to set that variable as an array – “string [] lines = loadString(sampleURL);”
3. Next use the join() function to put the contents of this array into a single string. The syntax for the join() function is “Join(string array to be joined, element to add between array elements)”. For example join(htmlPageArray, “ “) would join all the lines from a string array with a space between each element in the array.
4. Use string parsing functions described below to locate the data we want within an XML or HTML document/code. All of these methods tare part of the String class).
Parcing information from the Internet
First off you need to find the location of the data you are looking for by using the unique identifiers that you discovered during step one described above. Then you will use this information to extract data from the string. Remember that you can use a loop to look for multiple similar elements on a page. Here is the step-by-step:
- Learnings from the homework
- Displaying, reading and parsing information from the web
While reviewing this week’s homework we came across the use of double arrays (I could not find documentation for these types of arrays on the processing website). These arrays store two dimensions of data in a matrix that can be visualized as a spreadsheet or grid (check out the fig. a below). These arrays are the basis for image and video processing since to the computer a display is nothing more than a two-dimensional array.
- Syntax for declaring double arrays: “arrayType [][] arrayName;”

Another interesting type of array is the ArrayList. These are a special type of array that is dynamically allocated. What this means from a practical perspective is that you can add and remove elements while the program is running. An array lists is a more efficient solution than appending normal arrays. However, if you know how many elements you will need before run time, it is most efficient to use a standard array.
This power comes at a price, to use data from these arrays you need to create temporary local variables that are often not necessary when using regular arrays. An array list also has a different set of function than a normal array (even the ones that perform the same functions have different names,).
- Syntax for declaring an array list: “ArrayList arrayName;”
- Syntax for creating the array list: “arrayName = new ArrayList();”
- Syntax for adding element to array list “arrayName.add(new Class());” - the “new Class()” in this example can be replaced by a primitive date type such as int, char, etc.
- Syntax for extracting data from an array list: “Class tempVarName = (classOfArrayElement) arrayName.get(ArrayElementNumber);"
Displaying text information
During the second half of this week’s class we learned how to handle text - both how to display text and how to read text data from sources such as the Internet. I can’t wait to begin using these capabilities since data visualization is one of the areas that I hope to explore during my time at ITP. Let’s start with the basics and work our way up.
Definition of characters and strings:
- Characters (chars) is a data type for typographic characters, such as ‘a’, ‘b’, ‘c’ , and you get my drift. Chars are represented as ‘single’ quotes.
- Strings (String) is a data type that contains an array of chars. Unlike traditional arrays you don’t need to define the size of your string when you create it. Strings are represented by “double” quotes.
- Declare a variable of type PFont
- Define the variable usingloadFont() or createFont(). Do this during the sketch set-up because it requires a good amount of time.
- Use textFont() function to set the font type and size that you want to use for a single use of the text().
- Display text using the text() function. Method has several arguments: string, x and y coordinates, and width and length (optional).
On the other hand, createFont() enables to load a font at the moment the application is running. It also supports resizing of fonts without pixilation. However, if the person running the application does not have the selected font then the system defaults to an available font, which may look horrible with your design.
Capturing information from the Internet
For the most part, being able to take data from a website and using that data to impact a sketch takes a lot of detective work. The reason being you need to look at the source code from a website to understand how it is structured so that you can determine if there is a standard syntax that can enable your sketch to consistently find the information you want to capture. Here is an overview of the entire process
1. In practice this first step involves looking for identifiers within HTML/XML code that precede and follow the golden nugget of information you seek. It is always easier to use XML feeds than HTML code (and firefox is better to investigate XML than Safari). If using XML code you should leverage processing’s XML library. Once you have found the source on the internet from which you want to import data go to the next step.
2. Load the page into processing as a string using the loadStrings(URL) function. This method loads the document into an array of strings, each line is put into a separate element in the array. This means that when we are declaring a variable to import a text document we need to set that variable as an array – “string [] lines = loadString(sampleURL);”
3. Next use the join() function to put the contents of this array into a single string. The syntax for the join() function is “Join(string array to be joined, element to add between array elements)”. For example join(htmlPageArray, “ “) would join all the lines from a string array with a space between each element in the array.
4. Use string parsing functions described below to locate the data we want within an XML or HTML document/code. All of these methods tare part of the String class).
Parcing information from the Internet
First off you need to find the location of the data you are looking for by using the unique identifiers that you discovered during step one described above. Then you will use this information to extract data from the string. Remember that you can use a loop to look for multiple similar elements on a page. Here is the step-by-step:
- The function stringVar.indexOf(subStringSearch) returns the location within the stringVar where substring starts. If the subStringSearch is not found then it returns a -1 value. In order to find the start location of a sub string we need to add the length of the subStringSearch variable to value returned by this function.
- Once you have the location of the data use the stringVar.subString(start position inclusive, end position exclusive) to get the sub string that exists between the start and end point. It is important to always keep in mind how the start and end points of this function are handled differently.
Wednesday, October 21, 2009
Setting-up an Accelerometer - Success!
Earlier today I met with one of the residents at ITP to discuss the issues that I have been encountering with my 3-axis accelerometer (ADXL335). After meeting for a mere 5 minutes, Ithai informed me that the issue was likely being caused by the fact that I did not solder the leads into the breakout board. My initial instinct to NOT solder the header pins to the board in case the accelerometer was not working proved to be overly cautious.
Here are the charts featuring the latest data I collected from the accelerometer
The good news is that the accelerometer is now working, and I only pulled out a few hairs in the process. Now that this accelerometer is working I have a few additional learnings and resources to share with anyone working on hooking up an accelerometer. I hope these can help you get up and running without any hair pulling:
Code Sample 1 – As Simple as You Can Get
Code Sample 2 – Capture Base Readings and Then Report Difference from Base
This sample was developed by Andy Davidson, and taken from the Arduino message boards.
Here are the charts featuring the latest data I collected from the accelerometer
The good news is that the accelerometer is now working, and I only pulled out a few hairs in the process. Now that this accelerometer is working I have a few additional learnings and resources to share with anyone working on hooking up an accelerometer. I hope these can help you get up and running without any hair pulling:
- Make sure that you have soldered the pins to your accelerometer breakout board before starting to test.
- Use the AREF pin on the Arduino to set the reference voltage to 3v and improve the sensor readings.
- Use a running average of all readings or some other stabilization algorithm to help reduce noise from accelerometer readings.
- Check out the code samples below for different ways to test your new accelerometer.
- Whichever axis is in vertical position will have a different sensor reading due to gravity, even when resting.
- The sensor for each axis is only able to alternate resistance by +-15%.
Code Sample 1 – As Simple as You Can Get
int xAxis = 0;
int yAxis = 1;
int zAxis = 2;
int zInput = 0;
int yInput = 0;
int xInput = 0;
void setup () {
Serial.begin(9600);
}
void loop () {
xInput = analogRead(xAxis);
delay (10);
yInput = analogRead(yAxis);
delay (10);
zInput = analogRead(zAxis);
delay (10);
Serial.print("Inpu (xyz): ");
Serial.print(xInput);
Serial.print(", ");
Serial.print(yInput);
Serial.print(", ");
Serial.print(zInput);
Serial.println(".");
}
Code Sample 2 – Capture Base Readings and Then Report Difference from Base
This sample was developed by Andy Davidson, and taken from the Arduino message boards.
/* ADXL335test6
Test of ADXL335 accelerometer
Andy Davidson
*/
const boolean debugging = true; // whether to print debugging to serial output
const boolean showBuffer = false; // whether to dump details of ring buffer at each
read
const int xPin = 0; // analog: X axis output from accelerometer
const int yPin = 1; // analog: Y axis output from accelerometer
const int zPin = 2; // analog: Z axis output from accelerometer
const int led = 13; // just to blink a heartbeat while running
const int totalAxes = 3; // for XYZ arrays: 0=x, 1=y, 2=z
const int baseSamples = 1000; // number of samples to average for establishing
zero g base
const int bufferSize = 16; // number of samples for buffer of data for running
average
const int loopBlink = 100; // number of trips through main loop to blink led
// array of pin numbers for each axis, so the constants above can be chnaged with
impunity
const int pin [totalAxes] = {
xPin, yPin, zPin};
// base value for each axis - zero g offset (at rest when sketch starts)
int base [totalAxes];
// ring buffer for running average of data, one for each axis, each with
samples
int buffer [totalAxes] [bufferSize];
// index into ring buffer of next slot to use, for each axis
int next [totalAxes] = {
0,0,0};
// current values from each axis of accelerometer
int curVal [totalAxes];
// count of trips through main loop, modulo blink rate
int loops = 0;
void setup() {
long sum [totalAxes]= { // accumulator for calculating base value of each axis
0,0,0 };
Serial.begin (9600);
Serial.println ("***");
// initialize all pins
pinMode (led, OUTPUT);
for (int axis=0; axis
pinMode (pin [axis], INPUT); // not necessary for analog, really
// read all axes a bunch of times and average the data to establish zero g offset
// chip should be at rest during this time
for (int i=0; i
for (int axis=0; axis
sum [axis] += analogRead (pin [axis]);
for (int axis=0; axis
base [axis] = round (sum [axis] / baseSamples);
// and display them
Serial.print ("*** base: ");
for (int axis=0; axis
Serial.print (base [axis]);
Serial.print ("\t");
}
Serial.println ();
Serial.println ("***");
// initialize the ring buffer with these values so the averaging starts off right
for (int axis=0; axis
for (int i=0; i
buffer [axis] [i] = base [axis];
// light up the led and wait til the user is ready to start (sends anything on serial)
// so that the base values don't immediately shoot off the top of the serial window
digitalWrite (led, HIGH);
while (!Serial.available())
/* wait for */ ;
digitalWrite (led, LOW);
}
void loop() {
//increment the loop counter and blink the led periodically
loops = (loops + 1) % loopBlink;
digitalWrite (led, loops == 0);
// get new data from each axis by calling a routine that returns
// the running average, instead of calling analogRead directly
for (int axis=0; axis
curVal [axis] = getVal (axis, showBuffer);
if (debugging) {
Serial.print (curVal [axis]);
Serial.print ("\t");
}
}
if (debugging)
Serial.println ();
// here we will do all of the real work with curVals
}
int getVal (int axis, boolean show) {
// returns the current value on , averaged across the previous
reads
// print details if is true
long sum; // to hold the total for aaveraging all values in the buffer
// read the data into the next slot in the buffer and stall for a short time
// to make sure the ADC can cleanly finish multiplexing to another pin
buffer [axis] [next [axis]] = analogRead (pin [axis]);
delay (10); // probably not necessary given the stuff below
// display the buffer if requested
if (show) {
for (int i=0; i
if (i == next [axis]) Serial.print ("*");
Serial.print (buffer [axis] [i]);
Serial.print (" ");
}
Serial.println ();
}
// bump up the index of the next available slot, wrapping around
next [axis] = (next [axis] + 1) % bufferSize;
// add up all the values and return the average,
// taking into account the offset for zero g base
sum = 0;
for (int i=0; i
sum += buffer [axis] [i];
return (round (sum / bufferSize) - base [axis]);
}
Thursday, October 15, 2009
Serial Input Lab and the Etch-a-Sketch Sketch
This week our lab for Introduction to Physical Computing focuses on using serial communications to enable the Arduino microcontroller to interface with other processors such as a multimedia computer. That said, this same process can be used to enable the Arduino to interface with a multitude of other microprocessors and microcontrollers.
To keep things simple, the lab exercise only requires that we set up a single analog input on the Arduino board – a potentiometer. This component is used to control a graph that is generated in processing and displayed on the monitor of the multimedia computer. I have decided to take this one step further, and to attempt to make a virtual etch-a-sketch.
Here is a link to the lab page where you can find the overview and code samples for the original lab. Another helpful link is this overview about Serial Communications from Tom Igoe’s blog. In regards to the etch-a-sketch, all of the Arduino code is included below, the processing code can be found here. But first, check out the quick video that I put together about this small project.
Managing the Communication
When communicating more than one piece of data it is important to create a syntax that can enable the receiving computer to parse out different commands.
I decide to use the following protocol for my messages to enable me to parse out the two readings from the potentiometers: The data from the first potentiometer would always be preceded by a period, while the data from the second would always be preceded by a space and followed by a period, which marked the beginning of the first data element. For example “.255 0.255 1.254 2.” And you get the point.
From the Arduino side, to make sure that I could read the serial input clearly I set the Serial.print() mode to DEC to transmit the information. Then, once the information was parsed on the other end I converted the values back to numbers (floats) so that I could use these values to determine the location of the drawing on the screen.
On the processing side I encounter more challenges than with the Arduino. The biggest problem that I had to solve was choosing a strategy for accurately reading the data from the serial port. At first I tried to read the input one character at a time, as outlined in the code sample below. I am sad to say that this approach did not work well enough because there was too much noise.
The Wrong Approach to Reading the Data
I was able to get things working right by learning how to set Processing’s buffer size, which governs how many bytes are received before your application calls the serialEvent function. I set the buffer size to 20 and decided to capture one full string of 20 characters at a time. Then I proceeded to read just one set of readings from each of these buffer strings. This greatly stabilized the user experience.
Unfortunately, since potentiometers have a narrow rotation range it is not possible to create the true etch-a-sketch feeling with them. On screen you can use the arrow keys to draw – at ITP we will user the small controller pictured below to play around with this (at least for a couple of days until I decide to use these parts for my next little project).
Final Arduino Code
To keep things simple, the lab exercise only requires that we set up a single analog input on the Arduino board – a potentiometer. This component is used to control a graph that is generated in processing and displayed on the monitor of the multimedia computer. I have decided to take this one step further, and to attempt to make a virtual etch-a-sketch.Here is a link to the lab page where you can find the overview and code samples for the original lab. Another helpful link is this overview about Serial Communications from Tom Igoe’s blog. In regards to the etch-a-sketch, all of the Arduino code is included below, the processing code can be found here. But first, check out the quick video that I put together about this small project.
Managing the Communication
When communicating more than one piece of data it is important to create a syntax that can enable the receiving computer to parse out different commands.
I decide to use the following protocol for my messages to enable me to parse out the two readings from the potentiometers: The data from the first potentiometer would always be preceded by a period, while the data from the second would always be preceded by a space and followed by a period, which marked the beginning of the first data element. For example “.255 0.255 1.254 2.” And you get the point.
From the Arduino side, to make sure that I could read the serial input clearly I set the Serial.print() mode to DEC to transmit the information. Then, once the information was parsed on the other end I converted the values back to numbers (floats) so that I could use these values to determine the location of the drawing on the screen.
On the processing side I encounter more challenges than with the Arduino. The biggest problem that I had to solve was choosing a strategy for accurately reading the data from the serial port. At first I tried to read the input one character at a time, as outlined in the code sample below. I am sad to say that this approach did not work well enough because there was too much noise.
The Wrong Approach to Reading the Data
void serialEvent (Serial myPort) {
// read the port
readString = myPort.readChar();
// if a period is found then set read the next characters as xPos values
if (readString == char(46)) {
readNow = "xPos";
xPosString = "";
// else if a space is found then set read the next characters as yPos values
} else if (readString == char(32)) {
readNow = "yPos";
yPosString = "";
// else if values have been set to be read as xPos
} else if(readNow == "xPos") {
if (xPosString == null) {xPosString = readString;}
else { xPosString = xPosString + readString;}
xPosString = xPosString + readString;
// else if values have been set to be read as yPos
} else if(readNow == "yPos") {
if (yPosString == null) { yPosString = readString;}
else {yPosString = yPosString + readString;}
yPosString = yPosString + readString;
}
}
I was able to get things working right by learning how to set Processing’s buffer size, which governs how many bytes are received before your application calls the serialEvent function. I set the buffer size to 20 and decided to capture one full string of 20 characters at a time. Then I proceeded to read just one set of readings from each of these buffer strings. This greatly stabilized the user experience.
Unfortunately, since potentiometers have a narrow rotation range it is not possible to create the true etch-a-sketch feeling with them. On screen you can use the arrow keys to draw – at ITP we will user the small controller pictured below to play around with this (at least for a couple of days until I decide to use these parts for my next little project).
Final Arduino Code
int analogPin1 = 0;
int analogPin2 = 1;
int analogValue1 = 0;
int analogValue2 = 0;
void setup()
{
// start serial port at 9600 bps:
Serial.begin(9600);
}
void loop()
{
// read analog inputs:
analogValue1 = analogRead(analogPin1);
analogValue2 = analogRead(analogPin2);
// reduce range to appropriate range for analog output by dividing by 4
analogValue1 = analogValue1 / 4;
analogValue2 = analogValue2 / 4;
// print values to serial port
Serial.print(analogValue1, DEC);
Serial.print(" ");
Serial.print(analogValue2, DEC);
Serial.print(".");
delay(5 );
}
Wednesday, November 18, 2009
Starting to Learn Max/MSP
Earlier today I attended a Max/MSP tutorial run by one of my colleagues at ITP, Matt Ganechau. This one-and-a-half hour session was awesome. We went through the basic concepts that serve as the foundation for this programming environment, and then we developed our first Max patch – a simple 8-step sequencer. Here I will provide a brief overview of the main concepts that we covered along with a short video that features the sequencer I created.
Max/MSP is an object-oriented dataflow programming environment that enables artists to quickly and easily create prototypes. This language was created over 20 years ago to facilitate the creation of sound and music. One of its coolest features is that it includes powerful help functions that enable inexperienced users to quickly get up and running once they understand the following base concepts.
Objects in Max encapsulate functionality that can be re-used easily. Examples include dials, sliders, counters, etc. As in other OOP languages, users can create their own objects (called patches) that encapsulate additional functionality. Objects are identified by a green border and can be easily added to a program using a drag and drop interface. Once an object is added to the program, the user types in the object name to assign the object the desired functionality.
Objects in Max have nodes that are inlets and outlets. These nodes enable objects to connect to other objects. Inlets accept input, while outlets deliver output. When a user hovers over a node the Max environment will show a list of the possible objects and actions that can be connected to that node.
Aside from objects, Max/MSP also features messages. Messages transmit information between objects in Max and they can be integer and float values (there may be other types of messages that I have not explored yet).
Another important concept in Max is the “bang”. Everything in Max operates in response to bangs. Bangs are similar to pulses in an electric circuit, such as the Arduino. When a bang is initiated it goes through the system and activates sound and other activities.
Patches (or programs) can be locked or unlocked. Locked patches are in their performance state. In this mode the user can only interact with the patch as an interface – for example they can interact with sliders, toggles, etc. When unlocked the patch can be edited like a computer program.
The inspector enables developers to change the parameters of objects and programs. For example, on a slider object the programmer can change the range, color, and many other attributes. As expected the attributes and options available differ from object to object.
Max/MSP is an object-oriented dataflow programming environment that enables artists to quickly and easily create prototypes. This language was created over 20 years ago to facilitate the creation of sound and music. One of its coolest features is that it includes powerful help functions that enable inexperienced users to quickly get up and running once they understand the following base concepts.
Objects in Max encapsulate functionality that can be re-used easily. Examples include dials, sliders, counters, etc. As in other OOP languages, users can create their own objects (called patches) that encapsulate additional functionality. Objects are identified by a green border and can be easily added to a program using a drag and drop interface. Once an object is added to the program, the user types in the object name to assign the object the desired functionality.
Objects in Max have nodes that are inlets and outlets. These nodes enable objects to connect to other objects. Inlets accept input, while outlets deliver output. When a user hovers over a node the Max environment will show a list of the possible objects and actions that can be connected to that node.
Aside from objects, Max/MSP also features messages. Messages transmit information between objects in Max and they can be integer and float values (there may be other types of messages that I have not explored yet).
Another important concept in Max is the “bang”. Everything in Max operates in response to bangs. Bangs are similar to pulses in an electric circuit, such as the Arduino. When a bang is initiated it goes through the system and activates sound and other activities.
Patches (or programs) can be locked or unlocked. Locked patches are in their performance state. In this mode the user can only interact with the patch as an interface – for example they can interact with sliders, toggles, etc. When unlocked the patch can be edited like a computer program.
The inspector enables developers to change the parameters of objects and programs. For example, on a slider object the programmer can change the range, color, and many other attributes. As expected the attributes and options available differ from object to object.
Friday, October 9, 2009
Creating a Simple Arduino Controller for Processing Sketch
This week I finished my second gadget – a joystick for the bat invaders game that I have been developing in ICM class. The process that I used to create this device can be broken down into the following steps:
The work related to defining functionality requirements was straightforward and easy. Since the game had already been developed I knew exactly what I needed: two buttons to enable players to shoot bullets and to reset the game, and a controller that enable players to move left and right on the screen. The speaker was added towards the end of the development process hence it was not included in the original requirements definition.
Once these requirements had been defined it was easy to select the appropriate NC (normally closed) push buttons. The solution for controlling the left to right movement of the shooter bat was more challenging. I considered using a potentiometer, force sensors, a joystick switch (made of two potentiometers), and a double throw switch. In the end I opted for the double throw switch due to cost and usability considerations.
Connecting and testing the components was pretty straightforward. I made sure that all core components were working before moving forward with attempting to link Arduino to Processing. To determine which pins from the DTDP (double throw, double pole) switch needed to be connected to the power and input pin on the Arduino I used the continuity test on the multimeter. When I first connected this switch to the Arduino I encountered erratic input readings because I had forgotten to add resistors – this problem was quickly and easily fixed.
I did not test the speaker during this step in the process because I had not decided to add the speaker to the project yet. Once I decided to add the speaker I tested it using a slightly modified version of the code from last week’s tone lab. Then I played around with the tones in order to find two that were sufficiently different to identify bullet shots and bat deaths.
The next step was the toughest part of the entire process, getting Arduino and Processing to communicate with one another. Before starting to work on this project I had already made a failed attempt to use switches on the Arduino to control software developed with processing. With the help of Igal, and ITP colleague, I was finally able to get these two components to communicate analog input and output data (here is a link to a post on Igal’s website where he outlines the steps for making this happen).
Unfortunately, this was not the end of my woes. Though I was able to get analog input and output working I encountered another roadblock when I tried to create an Arduino sketch that would support digital input and output. To solve this issue I hooked up the digital switches to the analog input pins and used the analog values to drive digital behavior - e.g. if the input read higher than 100 then the switch was considered to be in the “on” state; otherwise it was considered to be in “off” state.
When I decided to add speakers as an output device I had to make updates to the Arduino sketch. In order to get this to work I had to take the following steps: (1) add the Tones library to the Arduino sketch; (2) create an object from the Tones class; (3) add code to the analogWriteCallback() function to play the appropriate tones when selected values are passed to the Arduino.
The final integration step was easy now that I had completed all of the pre-work described above – it took me under 30 minutes to get it all working properly.
I’ve posted the Arduino code below for your reference. Please note that the Processing code is available only on the Open Processing website. Also, I’ve commented out all of the elements associated to serial communications since the Open Processing site will not run Java applets that include serial commands.
Arduino Code for Bat Game Controller
- Define functionality requirements for the joystick
- Identify components that can meet these requirements
- Connect and test the components on the Arduino
- Get Arduino and Processing to work together
- Update Processing code to work with joystick
The work related to defining functionality requirements was straightforward and easy. Since the game had already been developed I knew exactly what I needed: two buttons to enable players to shoot bullets and to reset the game, and a controller that enable players to move left and right on the screen. The speaker was added towards the end of the development process hence it was not included in the original requirements definition.
Once these requirements had been defined it was easy to select the appropriate NC (normally closed) push buttons. The solution for controlling the left to right movement of the shooter bat was more challenging. I considered using a potentiometer, force sensors, a joystick switch (made of two potentiometers), and a double throw switch. In the end I opted for the double throw switch due to cost and usability considerations.
Connecting and testing the components was pretty straightforward. I made sure that all core components were working before moving forward with attempting to link Arduino to Processing. To determine which pins from the DTDP (double throw, double pole) switch needed to be connected to the power and input pin on the Arduino I used the continuity test on the multimeter. When I first connected this switch to the Arduino I encountered erratic input readings because I had forgotten to add resistors – this problem was quickly and easily fixed.
I did not test the speaker during this step in the process because I had not decided to add the speaker to the project yet. Once I decided to add the speaker I tested it using a slightly modified version of the code from last week’s tone lab. Then I played around with the tones in order to find two that were sufficiently different to identify bullet shots and bat deaths.
The next step was the toughest part of the entire process, getting Arduino and Processing to communicate with one another. Before starting to work on this project I had already made a failed attempt to use switches on the Arduino to control software developed with processing. With the help of Igal, and ITP colleague, I was finally able to get these two components to communicate analog input and output data (here is a link to a post on Igal’s website where he outlines the steps for making this happen).
Unfortunately, this was not the end of my woes. Though I was able to get analog input and output working I encountered another roadblock when I tried to create an Arduino sketch that would support digital input and output. To solve this issue I hooked up the digital switches to the analog input pins and used the analog values to drive digital behavior - e.g. if the input read higher than 100 then the switch was considered to be in the “on” state; otherwise it was considered to be in “off” state.
When I decided to add speakers as an output device I had to make updates to the Arduino sketch. In order to get this to work I had to take the following steps: (1) add the Tones library to the Arduino sketch; (2) create an object from the Tones class; (3) add code to the analogWriteCallback() function to play the appropriate tones when selected values are passed to the Arduino.
The final integration step was easy now that I had completed all of the pre-work described above – it took me under 30 minutes to get it all working properly.
I’ve posted the Arduino code below for your reference. Please note that the Processing code is available only on the Open Processing website. Also, I’ve commented out all of the elements associated to serial communications since the Open Processing site will not run Java applets that include serial commands.
Arduino Code for Bat Game Controller
/* Supports as many analog inputs and analog PWM outputs as possible. * * This example code is in the public domain. */ // Firmata library allows us to communiacte with Processing, we need to include it #include#include // variable that stores analogPin values byte analogPin; long unsigned playStart; long unsigned interval = 500; boolean playOn = false; Tone noiseMaker; // instance of the tone library void setup() { pinMode(13, OUTPUT); Serial.begin(9600); noiseMaker.begin(9); // these are calls to setup Firmata for communication Firmata.setFirmwareVersion(0, 1); // here we attach the analog message funciton, for digital communication // we can create other message callback functions and add them here Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); //bitrate, would be a good idea to have it same as in Processing Firmata.begin(115200); } void loop() { // check if Firmata library is loaded while(Firmata.available()) { Firmata.processInput(); } // for all the analog pins in Arduino, send the data in each to our Firmata library // which we will access from processing for(analogPin = 0; analogPin < TOTAL_ANALOG_PINS; analogPin++) { Firmata.sendAnalog(analogPin, analogRead(analogPin)); } } // function that handles all the analog call backs void analogWriteCallback(byte pin, int value) { pinMode(pin,OUTPUT); if (value > 3000) { noiseMaker.play(value, 5); } else { noiseMaker.play(value, 25); } }
Thursday, November 19, 2009
Course Selection for Spring Semester
It is hard to believe that it is already time to register for next semester's classes. I have an appointment with my advisor this afternoon to discuss my initial course selection. In preparation for this meeting I selected my 10 course choices, which I have listed below.
The way the process works here at ITP is that each student selects their top 10 course choices. Once all students have received approval on their course requests from their advisors, the process is turned over to an evil or benign algorithm (depending on who you ask). This algorithm determines who gets into which class.
My Top 10 List
The way the process works here at ITP is that each student selects their top 10 course choices. Once all students have received approval on their course requests from their advisors, the process is turned over to an evil or benign algorithm (depending on who you ask). This algorithm determines who gets into which class.
My Top 10 List
- Dataflow Audio Programming
- The Softness of Things
- Nature of Code
- Social Facts: Motivation
- Big Games
- If Products Could Tell Their Stories
- Design Expo
- Spatial Media
- Exhibit Design: NY Hall of Science
- Mechanisms and Things That Move
Tuesday, October 20, 2009
Linda Stone - Continuous Partial Attention and More
Earlier today I had the opportunity to hear Linda Stone speak at an Applications of Interactive Telecommunications Technology class. Linda has worked in the technology industry for over 20 years, having spent time at some of the sector’s biggest and most innovative organizations, such as Microsoft and Apple. Most recently, her attention has been focused on the phenomenon of “Continuous Partial Attention”.
Continuous partial attention refers to an artificial state of crisis that we create (that’s right we have to take responsibility here) because of our attempts to not miss anything and to be connected, always on, anytime, anywhere. This is a distinct phenomenon from multi-tasking, which usually connotes a focus on productivity (not the case with continuous partial attention). There is more information about this concept on Linda's blog.
Below I’ve compiled a brief overview of my notes from today’s event. My focus here has been to capture high-level ideas that may serve to inspire my future projects and research at ITP.
Top Three Ideas
Continuous partial attention refers to an artificial state of crisis that we create (that’s right we have to take responsibility here) because of our attempts to not miss anything and to be connected, always on, anytime, anywhere. This is a distinct phenomenon from multi-tasking, which usually connotes a focus on productivity (not the case with continuous partial attention). There is more information about this concept on Linda's blog.
Below I’ve compiled a brief overview of my notes from today’s event. My focus here has been to capture high-level ideas that may serve to inspire my future projects and research at ITP.
Top Three Ideas
- Our current always-on state of being is unhealthy and unsustainable
- Trend society’s focus moving from thinking and doing to sensing and feeling
- Opportunity to bring the body back into our interactions with computers
The condition of continuous partial attention keeps people in a constant state of fight or flight at a low-level. This state is not healthy or sustainable.
Book Recommendations
- Physiologically, the chemical impact of remaining in this state for prolonged periods of time has a negative impact on our mental and physical wellbeing.
- Medical research shows that being in a chronic state of fight or flight has negative physiological and psychological impacts (e.g. depression).
- Breathing exercises and meditation are one of the many tools that we can use to manage state of mind (and upstate the parasympathetic nervous system).
- When we engage with computers we often have bad posture and even neglect to breath.
- Breathing is linked to attention and emotions. Thus physical ways to engage with computational devices can help us on these levels as well.
- Opportunities to explore how to use ambient or environmental technologies to create contexts that help people relax by stimulating/engaging our parasympathetic nervous system.
- The Prius demonstrates how providing individuals with the ability to self-regulate is often sufficient to change behavior.
- The Fun Theory campaign from VW shows examples of how creating new interactions that are fun can also change the behavior of people. I've embedded one of the videos below.
Book Recommendations
- The New Science of Breadth by Elliott Stephen.
- Play by Steve Brown.
Thursday, October 15, 2009
Learning to Control Multiple Components Through One Pin
During last week’s Intro to Physical Computing class we briefly discussed how to control multiple components through a single pin on the Arduino. Here I will cover the two approaches that we discussed – using resistor ladders, and multiplexers - and share additional information I found online.
Resistor Ladders
Resistor ladders are electrical circuits that are referred to as ladders because they are made up of repeating units or resistors that create a ladder effect on the electrical current generated. The location of each component along the ladder determines the voltage that they are able to generate. The closer a switch is to the power source the higher the voltage that will flow through the circuit when that switch is opened. The Arduino is able to determine which element on the ladders is sending the input based on this shifting level of voltage provided.
Here is a brief description of the two most common types of resistor ladders (for all I know these may be the only types). A string resistor ladder consists of a serial string of resistors. Between each resistor there is a connection to an input pin. The pin that is closest to the power source is called the most significant bit, while the farthest away is labeled the least significant bit. The R-2R resistor ladder differs from a standard string ladder in that it also features a second resistor with each switch.
Aside from enabling the Arduino to capture input from multiple switches using a single pin, resistor ladders are also often used for analog to digital conversion.
Multiplexing
Multiplexing is a second solution for expanding the number of input pins on the Arduino (demultiplexing is a solution for expanding outputs on the Arduino). One benefit of multiplexors is that they are able expand digital and analog inputs and outputs, unlike the ladder approach. Multiplexors are dedicated components that are required for multiplexing and demultiplexing.
Let’s explore the 4051 multiplexer, which is commonly used with the Arduino. Here is a link to the page regarding multiplexing on the Arduino . This component features 12 input/output pins. 4 of these pins are used to govern communications between the Arduino and the multiplexer, 3 of these pins are used to assign which pin is active, the remaining transfers the actual input or output data between the multiplexer and Arduino. The other 8 pins are the assignable pins that are used to connect other processors, sensors or actuators. Below is a schematic of the 4051 multiplexer.
Port Manipulation
While reading about the concepts described above I came across some interesting information about port manipulation on the Arduino. Over the past week I had come across several mentions of the ports on the Arduino in online examples and conversations at ITP. I am happy to report that I finally understand this capability.
The benefit of port manipulation is that it allows for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. Here is a link to the page on the Arduino site that features more information about port manipulation.
The Arduino that runs an ATmega8 has the following three ports:
Resistor Ladders
Resistor ladders are electrical circuits that are referred to as ladders because they are made up of repeating units or resistors that create a ladder effect on the electrical current generated. The location of each component along the ladder determines the voltage that they are able to generate. The closer a switch is to the power source the higher the voltage that will flow through the circuit when that switch is opened. The Arduino is able to determine which element on the ladders is sending the input based on this shifting level of voltage provided.
Here is a brief description of the two most common types of resistor ladders (for all I know these may be the only types). A string resistor ladder consists of a serial string of resistors. Between each resistor there is a connection to an input pin. The pin that is closest to the power source is called the most significant bit, while the farthest away is labeled the least significant bit. The R-2R resistor ladder differs from a standard string ladder in that it also features a second resistor with each switch.Aside from enabling the Arduino to capture input from multiple switches using a single pin, resistor ladders are also often used for analog to digital conversion.
Multiplexing
Multiplexing is a second solution for expanding the number of input pins on the Arduino (demultiplexing is a solution for expanding outputs on the Arduino). One benefit of multiplexors is that they are able expand digital and analog inputs and outputs, unlike the ladder approach. Multiplexors are dedicated components that are required for multiplexing and demultiplexing.
Let’s explore the 4051 multiplexer, which is commonly used with the Arduino. Here is a link to the page regarding multiplexing on the Arduino . This component features 12 input/output pins. 4 of these pins are used to govern communications between the Arduino and the multiplexer, 3 of these pins are used to assign which pin is active, the remaining transfers the actual input or output data between the multiplexer and Arduino. The other 8 pins are the assignable pins that are used to connect other processors, sensors or actuators. Below is a schematic of the 4051 multiplexer.
Port Manipulation
While reading about the concepts described above I came across some interesting information about port manipulation on the Arduino. Over the past week I had come across several mentions of the ports on the Arduino in online examples and conversations at ITP. I am happy to report that I finally understand this capability.
The benefit of port manipulation is that it allows for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. Here is a link to the page on the Arduino site that features more information about port manipulation.
The Arduino that runs an ATmega8 has the following three ports:
- B (digital pin 8 to 13)
- C (analog input pins)
- D (digital pins 0 to 7)
- DDR register: determines whether the pin is an INPUT or OUTPUT (read/write)
- PORT register: controls whether the pin is HIGH or LOW (read/write)
- PIN register: reads the state of INPUT pins set to input with pinMode() (read)
- Here is a DDR register example: “DDRD = B11110000;” this sets half of the pins as outputs (the ones set to 1) and the other half as inputs (the ones set to 0).
- Here is a PORT register example: “PORTD = B11111111;” this sets all of the pins to high on a given port.
Subscribe to:
Posts (Atom)




