Skip navigation

Monthly Archives: November 2009

The serial lab required us to insert code and receive ASCII characters in the serial read-out part of Arduino. By using a potentiometer, we were able to vary the ASCII as it reads out. The position of the potentiometer, determined the letter or number that was reading out in the ASCII code. This is a first hand example of how serial is transmitted through objects on a basic level. You can see the bytes of info flying by as you turn the potentiometer.

The Second part of this lab required us to put the code into processing. This allowed us to get a visual of the serial output in graph form. By uploading the code to the arduino, now when we turn the potentiometer we will see a read out in graph form, marking the highs and lows are simply just turns of the potentiometer.

IN this lab, we were actually dealing with real motors, not servos. The difference is that motors have a continuos range, they can go in one direction for ever, unlike the servo in our kit. The first part of the lab was to get the motor going and spinning in one direction. It was setup through a circuit based of of the TIP120 transistor and our newly acquired h-bridge. Connecting the circuit to run through the H-bridge was a simple setup.

IMG_0772

Motor Connected to potentiometer

The second part of the lab, was to reverse the direction of the motor. This was pretty easy, just posting the code into place. The code is designed to switch the motors direction based on the position of the potentiometer. If it is high, it will spin in one direction, but if it is low, then it will spin in another direction.

IMG_0774

reversing motor 1

Screen shot 2009-11-11 at 2.47.33 PM

Shape

For these exercises we had to use programming again to complete the labs. The first lab was fairly simple, being that we just had to replicate shapes on the screen.

Screen shot 2009-11-11 at 2.49.30 PM

Swatches

This was the first challenge. To create two different color swatches and the  when each one is clicked have the drawing mechanism change color. The code for this was relatively simple in its construction once you figured out what pieces of code you actually need to use. Just setting the parameters to change color once the mouse is pressed inside of the different color squares is all that you need to do.  If the mouse is clicked within this area then change the color to this.

Screen shot 2009-11-11 at 2.50.53 PM

Character

The next part of the lab was to create a character that moved with the mouse. THe character that i chose to do was a robot. This was fairly simple as well. Building on the basics of programming that we have already done, using the mouse X and mouse y coordinates to make the character move with the mouse.

Screen shot 2009-11-11 at 2.52.07 PM

Animation

This part of the lad was a little more difficult that the previous step. This part delves into animation without the mouses input. This was easy at first because we only had to make it go in one direction. THe solution for this problem is that you have to increment its movement by 1 in x and y directions. This will cause the robot to move horizontally upward across the screen.

Screen shot 2009-11-11 at 2.53.59 PM

Square Lights

Square lights was the first difficult task. Having four boxes that change to white when the mouse in in that area. THis was challenging because at first you don’t know how to build it. Once you figure out how to build it, then it is becomes simpler. Once i figured out that its 4 different black squares with a pixel width in-between them, then it was easier. From there you just have to set up the sketch to read the different quadrants for each square and tell it to color change when the mouse is inside that area.

Screen shot 2009-11-11 at 2.53.01 PM

Color Swapper

Color Swapper

Screen shot 2009-11-11 at 2.54.42 PM

Race Track

Race Track

Screen shot 2009-11-11 at 2.55.18 PM

Bounce

Bounce

 

IMG_0748

Servo Connected

In this lab, we have to connect a servo tot he arduino board and get it to move. THis was a simple hook up, very similar to the other labs that we had that require analog output or feedback that was initially controlled by potentiometer. In this part of the lab, you can control the servo with the potentiometer. But not that effectively. WE can only turn it on and make it go. The code needed to be adjusted  to control the speed. Once that was done, you can incrementally control the speed of how fast that it spins.

IMG_0749

Speaker & Tone Library

For the second part of the lad, we needed to use tone, and a speaker to receive feedback. I downloaded the tone library and added it to my arduino, and connected the speaker. I then used the potentiometer to change and alter the sound to make annoying noises.

 

IMG_0753

Force Sensor Hello!

For the final part of this lab, i went back to the servo idea, and wanted to make something that was interesting. I decided to use a different input device instead of a potentiometer. I used a force sensor, and created a waving mechanism. The more force that it has the faster it waves. A quick hello!

 

 

In this lab, we will be dealing with processing. All code. THis will be a first for me as i have never coded anything. The first part of this lab, we were instructed to make our names read out in the reader display on the bottom of the program. This was easy enough. Follow simple instructions. use the print command to make it display.

Screen shot 2009-11-11 at 1.21.44 PM

Structure

The next part of the lab become more increasingly difficult. THis would be our first real sketch. It requres us to draw simple primitive shapes on the processing area. Because of the way that the processing area is mapped out, we have to use the X,Y orientation to plot the coordinates onto the area. Knowing the commands or the code for the primitive shapes was the easy part, but mapping out their individual points is whats hard. You really have to pay attention to the grid/ graphing system to get it exactly right.

Screen shot 2009-11-11 at 1.23.31 PM

First

The next step in this lab was to take it a little further with the primitive shapes and add attributes to them such as fill colors and stroke widths. This was fairly simple, once you understand how the loop is read and where to add the attributes so they will apply to the specific primitives, this lab became easily understood.

Screen shot 2009-11-11 at 1.24.41 PM

Form Color

The next step of this lab was to recreate a josef albers painting. This was cool, because if you have ever looked at a josef albers painting, then you will know that he focusses on simplicity. THis exercise was interesting. I used this to enhance my positioning skills. I wanted to get it almost exactly in the same position as it was on the painting, so i focused heavily on the pixel width and positioning.

Screen shot 2009-11-11 at 1.25.24 PM

Albers

Ok, now were getting a little more challenging with our processing. Creating a paintable area with processing is fairly hard. THe amount of time that i used just to discover a small amount of code is CRAZY!…and FUN! For this exercise we had to create a paint brush with processing. THis is where i discovered the mouse x mouse y code. THis made it very simple to map out a squares and have them follow my mouse like a paint brush would.

Screen shot 2009-11-11 at 1.26.08 PM

Paint Brush

The next portion of the lab would require me to use conditionals to make the brush only draw when the moused is pressed down. Mouse pressed…was obviously one of the conditionals that i needed to use in this part. This was a simple addition to the code that i already had. Just adding the moused pressed icon.

Screen shot 2009-11-11 at 1.26.55 PM

Mouse Brush

The next part of this lab is to create an area that the mouse can only paint in. This is also using a conditional to execute this processing feat.  Defining the perimeters of the the area and the conditionals that apply to that area are what make it work.

Screen shot 2009-11-11 at 1.28.15 PM

Area

And for the final, we just had to  make it have a button, that clears the screen. This was an interesting concept because, i didnt know how i was going to approach this problem. After i drew on the screen, i wanted it to be clear again once i pressed the button. I wanted to start the sketch over again with a clear screen, so thats what i did.

Screen shot 2009-11-11 at 2.16.19 PM

Final

 

 

 

 

 

 

 

 

IMG_0688For the first part of the Analog input lab, I connected a potentiometer to my Arduino board to control an LED. To do this i have to connect the potentiometer to a pulse width modulation port, which allows me to us its multiple states to control the brightness of the LED. The potentiometer acts as a voltage regulator which is why the LED gets dim and then brightens again. THis portion of the lab was straight forward. Using the digital ports for pwm, and connecting the potentiometer to the analog ports made this portion a breeze.

IMG_0690

10k

 

IMG_0692

1k

The second portion of the lab was to figure out the difference in the varying voltage between 10k and 1k resistors. A resistor is something that resist electrical current. The higher the resistor number the less current it will allow to pass. So obviously the 10k resistor is going to have more resistance than the 1k. I tested it will my multi meter and i was right. It clearly showed a difference in the voltage that was able to pass through. For this part i used a photo resistor as a measuring point.

 

IMG_0695For the final part of this lab, i had to construct a circuit that used analog input in an interesting way. I continued to use the photo resistor for this part of the project. I wanted to make a clock that measured the amount of light that was read and an LED would light up depending on how much light was getting emitted. THis was an interesting part of the lab, being the most complicated. At first i had the circuit hooked up, but it wasn’t functioning properly, because i didn’t have it wired right. I wasn’t using the series technique that we learned in the previous lab to set up my LED’s. Once I had my LED’s aligned in a series, i then saw the results that i needed.

For my imagined computing project, I wanted to do something that could benefit people in their everyday lives. The project that I invented is called the train tracker. The purpose of the train tracker is to give the user the ability to see where the trains are above ground before they go below. Using the iphone as a platform, it allows it to be mobile and very useful. Combining the iphone with underground RFID tags on the trains and in the subway tunnels, you can broadcast a signal of where particular trains are and will be at a specific time. This is useful, because it helps the user allocate their time efficiently. You will know when you need to rush and when you can take your time. You will never  be late or miss a train again!

Follow

Get every new post delivered to your Inbox.