|
Intro to Physical Computing Syllabus Research & Learning Other Class pages
ITP Help Pages |
Benedetta F2011-1Intro.BenedettaF2011-1 HistoryHide minor edits - Show changes to markup January 18, 2012, at 07:19 PM
by -
Changed line 56 from:
to:
December 08, 2011, at 03:39 PM
by -
Changed lines 737-740 from:
to:
Changed line 744 from:
to:
December 07, 2011, at 06:19 PM
by -
Changed line 742 from:
to:
December 07, 2011, at 10:42 AM
by -
Changed line 740 from:
to:
Changed line 742 from:
to:
December 06, 2011, at 08:16 PM
by -
Changed line 743 from:
to:
December 06, 2011, at 06:35 PM
by -
Changed line 738 from:
to:
December 06, 2011, at 06:19 PM
by -
Changed line 699 from:
to:
December 06, 2011, at 06:17 PM
by -
Changed line 698 from:
to:
December 06, 2011, at 06:15 PM
by -
Changed line 697 from:
to:
December 06, 2011, at 06:12 PM
by -
Changed line 737 from:
to:
Changed line 740 from:
to:
December 06, 2011, at 06:12 PM
by -
Changed line 740 from:
to:
December 06, 2011, at 06:10 PM
by -
Changed line 742 from:
to:
December 06, 2011, at 05:54 PM
by -
Changed line 742 from:
to:
December 06, 2011, at 04:21 PM
by -
Changed lines 737-739 from:
to:
Changed line 741 from:
to:
December 06, 2011, at 04:18 PM
by -
Changed lines 737-744 from:
to:
December 06, 2011, at 04:18 PM
by -
Added lines 735-744:
Office Hours Thursday 12/8:
November 29, 2011, at 01:10 PM
by -
Changed line 718 from:
December 12th\\ to:
December 12th Changed line 726 from:
December 14th\\ to:
December 14th November 29, 2011, at 01:09 PM
by -
Changed lines 716-717 from:
to:
Final Presentation Days & Groups:December 12th
December 14th
November 29, 2011, at 12:56 AM
by -
Changed line 713 from:
Patches from Luke's demo here! to:
Patches from Luke's demo here!\\ November 29, 2011, at 12:56 AM
by -
Deleted line 713:
November 29, 2011, at 12:55 AM
by -
Added lines 710-718:
Week11 - November 28thPatches from Luke's demo here! Click on the link called Lukes_patches.zip to download the Max Patches from class. November 28, 2011, at 01:44 PM
by -
Changed line 709 from:
to:
November 28, 2011, at 12:56 PM
by -
Changed line 707 from:
to:
November 28, 2011, at 12:49 PM
by -
Changed line 708 from:
to:
November 28, 2011, at 12:36 PM
by -
Changed line 707 from:
to:
November 28, 2011, at 12:10 PM
by -
Added line 706:
Deleted line 707:
November 27, 2011, at 09:19 PM
by -
Added line 709:
November 27, 2011, at 09:16 PM
by -
Changed line 704 from:
to:
November 27, 2011, at 09:16 PM
by -
Changed line 704 from:
to:
November 27, 2011, at 09:14 PM
by -
Changed line 701 from:
to:
November 27, 2011, at 09:11 PM
by -
Added line 708:
November 27, 2011, at 09:10 PM
by -
Added line 707:
November 27, 2011, at 09:05 PM
by -
Added line 705:
November 27, 2011, at 09:03 PM
by -
Added line 705:
November 27, 2011, at 08:59 PM
by -
Changed line 702 from:
to:
November 27, 2011, at 08:03 PM
by -
Changed line 702 from:
to:
November 27, 2011, at 04:23 PM
by -
Changed line 703 from:
to:
November 27, 2011, at 04:19 PM
by -
Changed lines 703-704 from:
to:
November 27, 2011, at 01:24 PM
by -
Changed lines 702-703 from:
to:
November 25, 2011, at 07:15 PM
by -
Changed lines 700-702 from:
to:
November 25, 2011, at 06:26 PM
by -
Changed lines 700-702 from:
to:
November 25, 2011, at 06:26 PM
by -
Changed lines 700-701 from:
to:
November 23, 2011, at 04:25 PM
by -
Changed lines 699-701 from:
to:
November 23, 2011, at 03:31 PM
by -
Changed lines 697-701 from:
to:
November 23, 2011, at 03:29 PM
by -
Added lines 695-697:
Final Projects Groups and IdeasNovember 23, 2011, at 03:28 PM
by -
Changed lines 592-593 from:
int enablePin = 9; // H-bridge enable pin to:
int enablePin = 9; // H-bridge enable pin Changed lines 628-629 from:
int enablePin = 9; // H-bridge enable pin to:
int enablePin = 9; // H-bridge enable pin Changed lines 672-673 from:
to:
#include <Stepper.h> Changed lines 675-676 from:
to:
#define STEPS 1000 Changed lines 678-679 from:
Stepper stepper(STEPS, 3, 4, 5, 6); to:
Stepper stepper(STEPS, 3, 4, 5, 6); November 23, 2011, at 03:26 PM
by -
Changed lines 584-585 from:
For reference +++ = Command Mode, ATCN = Data Mode to:
For reference +++ = Command Mode, ATCN = Data Mode Changed lines 590-593 from:
int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) int enablePin = 9; // H-bridge enable pin to:
int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) Changed lines 626-632 from:
- H-Bridge Lab Changing Direction & Speed on DC motor int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) int enablePin = 9; // H-bridge enable pin to:
int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) Changed lines 672-682 from:
- H-Bridge Lab Stepping a Stepper
// change this to the number of steps on your motor
// create an instance of the stepper class Stepper stepper(STEPS, 3, 4, 5, 6); to:
// change this to the number of steps on your motor November 23, 2011, at 03:25 PM
by -
Added lines 585-700:
Week10 - November 21stControlling DC Motor Direction with HBridge int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) int enablePin = 9; // H-bridge enable pin void setup() { Serial.begin(9600);
// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
// set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
} void loop() { // Turn on one direction:
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
delay (2000);
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
delay (2000);
} Controlling DC Motor Direction & Speed with HBridge - H-Bridge Lab Changing Direction & Speed on DC motor int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) int enablePin = 9; // H-bridge enable pin void setup() { Serial.begin(9600);
// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
// set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
} void loop() { // Turn on one direction:
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
for (int motorSpeed = 0; motorSpeed < 255; motorSpeed++){
analogWrite(enablePin, motorSpeed);
delay(4);
}
delay (2000);
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
for (int motorSpeed = 0; motorSpeed < 255; motorSpeed++){
analogWrite(enablePin, motorSpeed);
delay(4);
}
delay (2000);
} Controlling a Unipolar Stepper Motor with HBridge - H-Bridge Lab Stepping a Stepper
// change this to the number of steps on your motor
// create an instance of the stepper class Stepper stepper(STEPS, 3, 4, 5, 6); void setup() { Serial.begin(9600);
Serial.println("Resetting");
// set the speed of the motor to 30 RPMs
//stepper.setSpeed(30);
} void loop() { stepper.step(10);
Serial.println("Stepping");
delay(100);
} November 21, 2011, at 12:40 PM
by -
Changed line 63 from:
to:
November 12, 2011, at 05:51 PM
by -
Added lines 544-584:
Week8 - November 7thXBee set up Lab Plug in your XBee with PWR (3.3V), GND, TX and RX. You can use all sorts of USB to Serial converter for the XBees, I was using the simple FTDI breakout board from SparkFun. You program the XBees through CoolTerm or another Serial monitor program. 9600 baud rate, local echo and remember only CR as options.
These are some of the basic commands to program both XBees to send to each other over the same Pan ID. +++OK November 01, 2011, at 12:00 AM
by -
Changed lines 431-434 from:
// serialEvent method is run automatically by the Processing applet // whenever the buffer reaches the byte value set in the bufferUntil() // method in the setup(): to:
// serialEvent method is run automatically by the Processing applet October 31, 2011, at 11:57 PM
by -
Changed lines 460-461 from:
to:
Serial Communication to make the Arduino manipulate physical things - Physical Pixel: int ledPin = 13; // the pin that the LED is attached to // initialize serial communication: Serial.begin(9600); // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); } void loop() { // see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it's a capital H (ASCII 72), turn on the LED:
if (incomingByte == 'H') {
digitalWrite(ledPin, HIGH);
}
// if it's an L (ASCII 76) turn off the LED:
if (incomingByte == 'L') {
digitalWrite(ledPin, LOW);
}
}
} Processing code: import processing.serial.*; size(200, 200);
boxX = width/2.0;
boxY = height/2.0;
rectMode(RADIUS);
// List all the available serial ports in the output pane.
// You will need to choose the port that the Arduino board is
// connected to from this list. The first port in the list is
// port #0 and the third port in the list is port #2.
println(Serial.list());
// Open the port that the Arduino board is connected to (in this case #0)
// Make sure to open the port at the same speed Arduino is using (9600bps)
port = new Serial(this, Serial.list()[0], 9600);
}
void draw()
{
background(0);
// Test if the cursor is over the box
if (mouseX > boxX-boxSize && mouseX < boxX+boxSize &&
mouseY > boxY-boxSize && mouseY < boxY+boxSize) {
mouseOverBox = true;
// draw a line around the box and change its color:
stroke(255);
fill(153);
// send an 'H' to indicate mouse is over square:
port.write('H');
}
else {
// return the box to it's inactive state:
stroke(153);
fill(153);
// send an 'L' to turn the LED off:
port.write('L');
mouseOverBox = false;
}
// Draw the box
rect(boxX, boxY, boxSize, boxSize);
}
October 31, 2011, at 11:52 PM
by -
Changed lines 249-250 from:
Punctuation Method - Virtual Color Mixer Example: to:
Punctuation Method - Virtual Color Mixer: Changed line 289 from:
Processing code: to:
Processing code: Added lines 345-461:
Handshaking/Call and Response Method in ASCII: int firstSensor = 0; // first analog sensor // start serial port at 9600 bps: Serial.begin(9600); pinMode(2, INPUT); // digital sensor is on digital pin 2 establishContact(); // send a byte to establish contact until receiver responds } void loop() { // if we get a valid byte, read analog ins:
if (Serial.available() > 0) {
// get incoming byte:
inByte = Serial.read();
// read first analog input, divide by 4 to make the range 0-255:
firstSensor = analogRead(A0);
// delay 10ms to let the ADC recover:
delay(10);
// read second analog input, divide by 4 to make the range 0-255:
secondSensor = analogRead(A1);
// read switch, map it to 0 or 255L
thirdSensor = map(digitalRead(2), 0, 1, 0, 255);
// send sensor values:
Serial.print(firstSensor);
Serial.print(",");
Serial.print(secondSensor);
Serial.print(",");
Serial.println(thirdSensor);
}
} void establishContact() { while (Serial.available() <= 0) {
Serial.println("0,0,0"); // send an initial string
delay(30);
}
} // Processing code to run with this example: size(640,480);
// List all the available serial ports
println(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Arduino module, so I open Serial.list()[0].
// Change the 0 to the appropriate number of the serial port
// that your microcontroller is attached to.
myPort = new Serial(this, Serial.list()[0], 9600);
// read bytes into a buffer until you get a linefeed (ASCII 10):
myPort.bufferUntil('\n');
// draw with smooth edges:
smooth();
} void draw() { background(bgcolor); fill(fgcolor); // Draw the shape ellipse(xpos, ypos, 20, 20); } // serialEvent method is run automatically by the Processing applet // whenever the buffer reaches the byte value set in the bufferUntil() // method in the setup(): void serialEvent(Serial myPort) { // read the serial buffer:
String myString = myPort.readStringUntil('\n');
// if you got any bytes other than the linefeed:
myString = trim(myString);
// split the string at the commas
// and convert the sections into integers:
int sensors[] = int(split(myString, ','));
// print out the values you got:
for (int sensorNum = 0; sensorNum < sensors.length; sensorNum++) {
print("Sensor " + sensorNum + ": " + sensors[sensorNum] + "\t");
}
// add a linefeed after all the sensor values are printed:
println();
if (sensors.length > 1) {
xpos = map(sensors[0], 0,1023,0,width);
ypos = map(sensors[1], 0,1023,0,height);
fgcolor = sensors[2];
}
// send a byte to ask for more data:
myPort.write("A");
}
October 31, 2011, at 11:48 PM
by -
Changed line 255 from:
to:
\\ October 31, 2011, at 11:46 PM
by -
Added lines 247-344:
Punctuation Method - Virtual Color Mixer Example: int xPin = A0; // pinMode(switchPin, INPUT);
Serial.begin(9600);
//Serial.println("hello world");
} void loop (){ xValue = analogRead(xPin);
Serial.print(xValue);
Serial.print(",");
yValue = analogRead(yPin);
Serial.print(yValue);
Serial.print(",");
zValue = analogRead(zPin);
Serial.println(zValue);
// button = digitalRead(switchPin);
// Serial.println(button);
} // Processing code for this example float redValue = 0; // red value
float greenValue = 0; // green value
float blueValue = 0; // blue value
Serial myPort;
void setup() {
size(200, 200);
// List all the available serial ports
println(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Arduino, so I open Serial.list()[0].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);
// don't generate a serialEvent() unless you get a newline character:
myPort.bufferUntil('\n');
}
void draw() {
// set the background color with the color values:
background(redValue, greenValue, blueValue);
}
void serialEvent(Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil('\n');
if (inString != null) {
// trim off any whitespace:
inString = trim(inString);
// split the string on the commas and convert the
// resulting substrings into an integer array:
float[] colors = float(split(inString, ","));
// if the array has at least three elements, you know
// you got the whole thing. Put the numbers in the
// color variables:
if (colors.length >=3) {
// map them to the range 0-255:
redValue = map(colors[0], 0, 900, 0, 255);
greenValue = map(colors[1], 0, 900, 0, 255);
blueValue = map(colors[2], 0, 900, 0, 255);
}
}
}
\\ October 31, 2011, at 11:43 PM
by -
Changed lines 218-219 from:
int xPin = A0; // the analog pin our accelerometer is plugged into\\ to:
int xPin = A0; // the analog pin our accelerometer is plugged into Deleted lines 220-221:
int xValue = 0; // the value from the x Pin October 31, 2011, at 11:42 PM
by -
Changed lines 218-221 from:
int xPin = A0; // the analog pin our accelerometer is plugged into int xValue = 0; // the value from the x Pin to:
int xPin = A0; // the analog pin our accelerometer is plugged into October 31, 2011, at 11:41 PM
by -
Changed lines 216-223 from:
Different Data Formats int xPin = A0; int yPin = A1; int xValue = 0; int yValue = 0; to:
Different Data Formats: int xPin = A0; // the analog pin our accelerometer is plugged into int xValue = 0; // the value from the x Pin Added line 226:
Changed lines 231-234 from:
xValue = analogRead(xPin)/4;
Serial.print("x = ");
Serial.println(xValue);
delay(10);
to:
xValue = analogRead(xPin);
Serial.print("x = "); // just some nice formatting
Serial.println(xValue); // print the ASCII encoded decimal value
Changed lines 236-244 from:
Serial.write(xValue); // Print the raw binary value analogValue
Serial.print('\t'); // print a tab
Serial.print(xValue, BIN); // print the ASCII encoded binary analogValue
Serial.print('\t'); // print a tab
Serial.print(xValue, DEC); // print the ASCII encoded decimal analogValue
Serial.print('\t'); // print a tab
Serial.print(xValue, HEX); // print the ASCII encoded hexadecimal analogValue
Serial.print('\t'); // print a tab
Serial.println(xValue, OCT); // print the ASCII encoded octal analogValue
to:
Serial.write(xValue); // Print the raw binary value
Serial.print('\t'); // print a tab
Serial.print(xValue, BIN); // print the ASCII encoded binary value
Serial.print('\t'); // print a tab
Serial.print(xValue, DEC); // print the ASCII encoded decimal value (same as above)
Serial.print('\t'); // print a tab
Serial.print(xValue, HEX); // print the ASCII encoded hexadecimal value
Serial.print('\t'); // print a tab
Serial.println(xValue, OCT); // print the ASCII encoded octal value
Changed line 246 from:
delay(500); to:
delay(300); // just so that you can read them slowly October 31, 2011, at 11:36 PM
by -
Added lines 212-249:
Code from class: int xPin = A0; int yPin = A1; int xValue = 0; int yValue = 0; void setup(){ Serial.begin(9600);
Serial.println("hello world");
} void loop (){ xValue = analogRead(xPin)/4;
Serial.print("x = ");
Serial.println(xValue);
delay(10);
// print in many formats:
Serial.write(xValue); // Print the raw binary value analogValue
Serial.print('\t'); // print a tab
Serial.print(xValue, BIN); // print the ASCII encoded binary analogValue
Serial.print('\t'); // print a tab
Serial.print(xValue, DEC); // print the ASCII encoded decimal analogValue
Serial.print('\t'); // print a tab
Serial.print(xValue, HEX); // print the ASCII encoded hexadecimal analogValue
Serial.print('\t'); // print a tab
Serial.println(xValue, OCT); // print the ASCII encoded octal analogValue
delay(500);
}
October 31, 2011, at 09:49 AM
by -
Added lines 209-211:
Week6 - October 24thWeek7 - October 31stOctober 24, 2011, at 12:35 PM
by -
Changed lines 205-209 from:
to:
October 23, 2011, at 12:58 PM
by -
Added line 206:
Changed lines 209-210 from:
to:
October 23, 2011, at 10:38 AM
by -
Added line 205:
Changed lines 209-210 from:
to:
October 23, 2011, at 12:30 AM
by -
Added line 204:
Changed lines 209-210 from:
to:
October 21, 2011, at 05:22 PM
by -
Changed lines 203-209 from:
- Rose, Ryan and Mark; - - - - - to:
October 21, 2011, at 05:21 PM
by -
Added lines 199-209:
Week5 - October 17thMedia Controller Groups: - Rose, Ryan and Mark; - - - - - October 19, 2011, at 06:26 PM
by -
Deleted line 60:
October 17, 2011, at 03:27 PM
by -
Changed lines 66-67 from:
to:
October 11, 2011, at 12:38 PM
by -
Changed line 50 from:
to:
October 08, 2011, at 05:01 PM
by -
Changed lines 165-166 from:
\\ to:
Changed lines 168-169 from:
to:
#include <Servo.h> // include the servo library October 08, 2011, at 05:00 PM
by -
Changed lines 126-127 from:
to:
Added line 165:
\\ October 08, 2011, at 04:59 PM
by -
Added lines 126-127:
Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3. Changed lines 129-135 from:
'''
Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3.'''
to:
Changed lines 163-165 from:
'' Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library.''' \\ to:
Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library. October 08, 2011, at 04:58 PM
by -
Changed lines 129-131 from:
/* Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3. */ \\ to:
''' Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3.''' \\ Changed lines 167-168 from:
''' /* Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library.*/''' \\ to:
'' Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library.''' \\ Deleted lines 170-171:
October 08, 2011, at 04:56 PM
by -
Changed line 129 from:
/* Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3. */ \\ to:
/* Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3. */ \\ Changed lines 165-171 from:
/* Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library.
to:
''' /* Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library.*/''' \\ October 08, 2011, at 04:55 PM
by -
Changed lines 129-133 from:
/* Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3.
to:
/* Analog Input and Analog Output: Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3. */ \\ October 08, 2011, at 04:55 PM
by -
Changed lines 132-133 from:
dimming a light emitting diode(LED), using PWM functionality of pin 3.
to:
dimming a light emitting diode(LED), using PWM functionality of pin 3.
Changed lines 171-172 from:
- Lab controlling servomotor (!!!!!!Check on computer before class!!!!!) to:
/* Demonstrates analog input by reading an analog sensor on analog pin 0 and controlling a servo motor on pin 9 using the Servo library.
October 08, 2011, at 04:53 PM
by -
Added lines 125-203:
Code from class: /* Demonstrates analog input by reading an analog sensor on analog pin 0 and dimming a light emitting diode(LED), using PWM functionality of pin 3.
//declare our FSR pin int sensorPin = A0; //declare our FSR value int sensorValue = 0; //declare LED pin int ledPin = 3; void setup(){ //init Serial monitor Serial.begin(9600); //declare our output pinMode(ledPin, OUTPUT); } void loop(){ sensorValue = analogRead(sensorPin); //read our FSR value // we remember that the range of our FSR 0 - 980 int brightness = map(sensorValue, 0, 980, 0, 255); //remap the sensor value to a range from 0 to 255 analogWrite(ledPin, brightness); //PWM led pin 0 - 255 resolution Serial.println(sensorValue); delay (10); } - Lab controlling servomotor (!!!!!!Check on computer before class!!!!!)
Servo servoMotor; // creates an instance of the servo object to control a servo int servoPin = 9; // Control pin for servo motor int sensorPin = A0; // Pin our FSR is plugged into int sensorValue = 0; // initialize value at 0 void setup() { Serial.begin(9600); // initialize serial communications servoMotor.attach(servoPin); // attaches the servo on pin 3 to the servo object } void loop() { sensorValue = analogRead(sensorPin); // read the analog input Serial.println(sensorValue); // print it delay(5); // if your sensor's range is less than 0 to 1023, you'll need to // modify the map() function to use the values you discovered: int servoAngle = map(sensorValue, 0, 975, 0, 179); // Serial.println(servoAngle); // delay(5); // move the servo using the angle from the sensor: servoMotor.write(servoAngle); } October 08, 2011, at 04:51 PM
by -
Changed lines 122-123 from:
Week4 - October 3rd
to:
Week4 - October 3rdOctober 08, 2011, at 04:51 PM
by -
Changed lines 121-122 from:
(this is the Arduino playground, where people have contributed with code and libraries to interface different things with Arduino) to:
(this is the Arduino playground, where people have contributed with code and libraries to interface different things with Arduino) September 26, 2011, at 05:31 PM
by -
Changed lines 118-122 from:
to:
September 26, 2011, at 04:56 PM
by -
Changed lines 111-118 from:
to:
Some resources on accelerometers (we will look at this sensor in class in a few weeks) September 26, 2011, at 04:44 PM
by -
Changed lines 102-103 from:
to:
Schematic Symbols (I will cover most schematic symbols of thing we use in class, but the Internetz is a great place to look them up): September 26, 2011, at 04:28 PM
by -
Changed lines 97-99 from:
http://www.lionconservation.org/ to:
http://www.lionconservation.org/ September 26, 2011, at 04:27 PM
by -
Changed lines 93-94 from:
to:
September 26, 2011, at 04:26 PM
by -
Changed lines 92-93 from:
http://home.groundlab.cc/lioncollars.html\\ \\ to:
http://home.groundlab.cc/lioncollars.html September 26, 2011, at 04:26 PM
by -
Changed line 92 from:
http://home.groundlab.cc/lioncollars.html\\ to:
http://home.groundlab.cc/lioncollars.html\\ \\ September 26, 2011, at 04:26 PM
by -
Changed line 91 from:
Lion Tracking Project (mentioned in class because of all the animal tracking fantasy devices!): to:
Lion Tracking Project (mentioned in class because of all the animal tracking fantasy devices!):\\ Changed lines 93-94 from:
The actual conservancy theory behind the project: http://lionguardians.wildlifedirect.org/ to:
The actual conservancy theory behind the project: September 26, 2011, at 04:26 PM
by -
Changed lines 92-94 from:
http://home.groundlab.cc/lioncollars.html ''' The actual conservancy theory behind the project''': to:
http://home.groundlab.cc/lioncollars.html September 26, 2011, at 04:25 PM
by -
Added lines 88-98:
Useful links from class: Lion Tracking Project (mentioned in class because of all the animal tracking fantasy devices!): http://home.groundlab.cc/lioncollars.html ''' The actual conservancy theory behind the project''': http://lionguardians.wildlifedirect.org/ http://www.lionconservation.org/ September 26, 2011, at 12:37 PM
by -
Changed line 63 from:
to:
September 26, 2011, at 12:36 PM
by -
Changed line 61 from:
to:
September 26, 2011, at 12:31 PM
by -
Changed line 58 from:
to:
September 26, 2011, at 12:31 PM
by -
Changed line 53 from:
to:
September 26, 2011, at 12:29 PM
by -
Changed line 53 from:
to:
Changed line 87 from:
Week3 - September 26th\\to:
Week3 - September 26th\\September 26, 2011, at 12:29 PM
by -
Changed line 59 from:
to:
September 26, 2011, at 12:28 PM
by -
Changed line 53 from:
to:
September 26, 2011, at 12:26 PM
by -
Changed line 64 from:
to:
September 25, 2011, at 09:23 PM
by -
Added line 87:
Week3 - September 26th\\September 19, 2011, at 03:45 PM
by - September 19, 2011, at 12:52 PM
by -
Changed line 60 from:
to:
September 19, 2011, at 12:35 PM
by -
Changed line 52 from:
to:
September 19, 2011, at 12:26 PM
by -
Changed line 51 from:
to:
September 18, 2011, at 11:37 PM
by -
Changed line 50 from:
to:
September 18, 2011, at 10:57 PM
by - September 18, 2011, at 10:54 PM
by -
Changed lines 65-66 from:
to:
September 18, 2011, at 09:32 PM
by - September 18, 2011, at 09:31 PM
by -
Changed lines 1-2 from:
Ioni Gkliati: http://itp.nyu.edu/~ig624/blog/ to:
InfoWhat: Intro to Physical Computing H79.2301.2 ContactBest way to reach me is via email at: bp432@nyu.edu GradingParticipation & Attendance: 40% SuppliesSee http://itp.nyu.edu/physcomp/Intro/Supplies Useful Linkshttp://www.arduino.cc - Arduino website. Check out the Getting Started and the Reference pages Cool Reference BooksPhysical Computing: Sensing and Controlling the Physical World with Computers Class BlogsPlease press "Edit" at the bottom of this page, login and enter the url to your blog (if you are new to wiki formatting just follow the pattern)
Notes from ClassWeek1 - September 12th
Resistors Breadboards Some Helpful Online Components Stores Week2 - September 19th
|