Life@ITP

December 17, 2005

MIDI Lab

Filed under: Physical Computing

MIDI or Musical Instrument Digital Interface is a protocol developed for communication between digital synthesizers and other digital music devices.

For this lab I used a sythesizer which was connected to my microcontroller. The program takes a value from an analog sensor and uses it ro generate the pitch of a note played once every quarter of a second.

‘ the sensor is on pin RA0 The MIDI is on pin RC6
‘ Make sure to select Configuration, Oscillator, HS
‘ in EPICWIN when programming:
DEFINE OSC 20
DEFINE ADC_BIT 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 15

‘ set up serial UART registers:
define HSER_RCSTA 90h
define HSER_TXSTA 20h
define HSER_BAUD 31250

TRISA = %11111111
‘ set up ADCON1
ADCON1 = %10000010

‘ declare an array of 12 word variables:
pitch var byte (12)

‘ declare other variables:
note var byte
ADCVar var word

‘ the 12 elements of the array called pitch are the 12 notes of a scale:
pitch (0) = 60 ‘ middle C
pitch (1) = 61 ‘ C#
pitch (2) = 62 ‘ D
pitch (3) = 63 ‘ D#
pitch (4) = 64 ‘ E
pitch (5) = 65 ‘ F
pitch (6) = 66 ‘ F#
pitch (7) = 67 ‘ G
pitch (8) = 68 ‘ G#
pitch (9) = 69 ‘ A
pitch (10) = 70 ‘ A#
pitch (11) = 71 ‘ B

main:
‘My potentiometer gave a range from 0 to 1023
ADCin 0. ADCVar
‘ connect to a range from 0 to 11:
Note = ADCVAR / 100
‘ play note:
hserout [$90. pitch(note), $40]
pause 250
‘ noteoff:
hserout [$80, pitch(note), $00]
goto main

Week 6 Lab

Filed under: Physical Computing

I finally had a chance to work on my week 6 lab assignment. I couldn’t get my hands on a H-bridge so I did the next best thing…use a TIP120 which only allowed me to vary the speed of the motor by receiving pause intervals. After finals I was basically broke so I got the cheapest DC motor I could find at Radio Shack, a 1.5 - 3v DC hobby motor.

I got the DC motor to do what it’s supposed to do, which is to spin. The ER room was out of still camera’s so I didn’t have a chance to take any photos but below is the code I used to program my PIC chip.

‘define oscillator @ 4mhz
DEFINE OSC 4

‘ make ports D1 output

output PORTD.1

pause 500 ‘ start program with a half-second delay

main:

high PORTD.1

pause 1000 ‘ turns motor power on for 1 second

low PORTD.1

pause 1000 ‘ turns power off for 1 second

goto main

December 15, 2005

Ping Pong Remix Wireless Presentation

Filed under: Physical Computing

Everything’s done and completed…Steve did this incredible paddle sound selector on Processing and we’re all set!

PowerPoint Presentation

Re-Paddling

Filed under: Physical Computing

We decided it was best to redo the paddles all together, so we both went to Paragon at Union Square and bought 5 dollar paddles to break apart and Piezo buzzers at Radio Shack. The Rubber on the paddles were stripped open as well as the wood on the handles.

The Peizo buzzers were soldered, red is to power, blue is to analog and black is to ground. Then a hole was cut in the middle of the handles as shown in the pictures in order to place the wires that go from the peizo buzzer to the transmitter boards.

After making the hole, the Piezo Buzzer is placed under the rubber ever so carefully as the wires of the Piezo buzzers are very very sensitive and glued with the gorrila glue. The new buzzered paddles are clamped down and left to dry overnight.

The reciever box was re-designed to be more accessible and to look more prefessional and the transcievers are now placed in a little pouch.

I have to say I was glad we redid the paddles because it gave me a chance to see how the paddles actually worked and what was really used to get data from the paddles to the pic chip. Speaking of pic chips, the pic chips for the transmitter boards were changed from the larger 18F452 to the smaller 18F252 which has 28 pins. It was best to use a smaller Pic chips since we were using a smaller breadboard and we needed more space on the board to fit everything together.

Below are few pictures of our preparations:

IMG_4434

IMG_4435

IMG_4433

P1010033

P1010031

P1010030

P1010028

P1010027

P1010012

P1010014

P1010018

P1010021

P1010022

P1010023

A flash representation of how the paddles work

December 13, 2005

ReDesigned Cutting board

Filed under: Communications Lab

Well my product is EXTREMELY simple and I’m not sure how much of a technology it is, since there are no wires or light or anything of that sort. It’s just a plain cutting board.

The main reason I decided to redesin a cutting board is because my mom is here for a visit and we have been cooking so much and I have been using the cutting board alot these past weeks. Anyways below is my design.

December 8, 2005

Ping Pong - The Remix

Filed under: Physical Computing

logopingpong

We finally got the Paddle to work wirelessly, and we have figured out how we will be strapping the paddles. What we have decided so far is to mount the breadboard and having these velcro straps wrap around them We hope to get everything done by this weekend so we will be able to do some userbility testing and be able to video tape the users in action! Below is the code we did.

‘****************************************************************
‘* Name : PP-PADDLE
‘* Author : Steven Jackson / Fazreen Kuhiri
‘* Notice : Copyright (c) 2005
‘* : All Rights Reserved
‘* Date : 12/1/2005
‘* Version : 1.0
‘* Notes : sending serial out (transmitter) from paddle
‘****************************************************************

define osc 4

‘ Define ADCIN parameters
DEFINE ADC_BITS 10 ‘ Set number of bits in result
DEFINE ADC_CLOCK 3 ‘ Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 20 ‘ Set sampling time in uS

PeakValue var word
SensorValue var word
LastSensorValue var word
Threshold var word
Noise var word

Threshold = 50 ‘ set your own value based on your sensors
PeakValue = 0 ‘ initialize peakValue
noise = 5 ‘ set a noise value based on your particular sensor

‘ Set PORTA to all input
TRISA = %11111111

‘ Set up ADCON1
ADCON1 = %10000010

inv2400 con 16780

thisByte var byte
adcVar var word
blink var byte

output portd.1
output portd.2
OUTPUt portd.3
input portb.0

i var byte

pause 500

main:
‘ read sensor on pin RA0:
ADCin 3, sensorValue

‘ check to see that it’s above the threshold:
If sensorValue >= threshold + noise then

‘ if it’s greater than the last reading,
‘ then make it our current peak:
If sensorValue >= lastSensorValue + Noise then
PeakValue = sensorValue
endif

‘ if the sensorValue is not above the threshold,
‘ then the last peak value we got would be the actual peak:
Else
If peakValue >= threshold then

‘ this is the final peak value; take action
thisByte = 1

for i = 0 to 5 step 1
serout2 portd.3, inv2400, [65, dec thisbyte]
next i
’serout2 portd.3, inv2400, [83, DEC thisByte, 10]

high portd.1
pause 200
low portd.1
pause 200
endif

‘ reset peakValue, since we’ve finished with this peak:
peakValue = 0
Endif

‘ store the current sensor value for the next loop:
lastSensorValue = sensorValue

goto main

——————————————————————————-

‘****************************************************************
‘* Name : PP-RECEIVER_BOX
‘* Author : Steven Jackson / Fazreen Kuhiri
‘* Notice : Copyright (c) 2005
‘* : All Rights Reserved
‘* Date : 12/1/2005
‘* Version : 1.0
‘* Notes : sending serial out (transmitter) from paddle
‘*
‘****************************************************************
inbyte var byte ‘ incoming string
inbyte2 VAR BYTE

output portb.1 ‘ status LED
output portc.6 ‘ serial out to PC
input portc.7 ‘ serial in from receiver

n_2400 con 16780 ‘ baud mode for serin2 (2400-8-N-1 inverted)
n_9600 con 16468 ‘ baud mode for serin2 (9600-8-N-1 inverted)

i var byte ‘ loop counter

RFSerialIn var portc.7
PCSerialOut VAR portc.6
StatusLED var portb.1
PingPong VAR WORD
PingPong = 420

‘ flash status LED to start:
high StatusLED
pause 500
low StatusLED

main:
‘ this serial call does nothing until it gets bytes:
serin2 RFserialIn, n_2400, [wait(65), inbyte]
serout2 pcserialout, n_9600, [inbyte]
goto main

December 6, 2005

Robbie’s Heartbreak

Filed under: Communications Lab

Since I have some Flash Experiance and mostly because I didn’t have time to work in group for this assignment, because of Red’s Presentation and Finals. I decided it was best if I did this on my own. As I said earlier I do have some flash experiance, but mostly it’s self taught and learning by trial and error. Flash is definitely one of my favorite softwares to work with just because you can do alot with it. I still have a long ways to go to get better at Flash, but I love using it and learning more and more everytime I work with it.

I have not had time to really finish this animation, but I will and the file will be here.




December 1, 2005

Ping Pong - The Remix

Filed under: Physical Computing

wireless

_MG_4048

_MG_4049

_MG_4050

_MG_4052

We’ve decided to make the signal digital rather than analog because there was too much data being sent through, so it was much easier to have it digital.

We also have a back up plan….IN CASE the WHOLE WIRELESS thing doesn’t work out, and it’s to combine everything in one big box. Since we are still getting some signal difficulties.

bigbox






















Get free blog up and running in minutes with Blogsome | Theme designs available here