All posts by jessiecontour

Midterm – Autonomous Car

IMG_20141018_205558926 copy IMG_20141018_205622674_HDR copy
Inputs: distance sensor and photocell
Outputs: motors and LED headlights.
The distance sensor looks ahead of the car and if it senses something too close it backs up and turns and then continues on it’s way.
The photocell senses when it is too dark and turns on the headlights on the car.
Here is a link to my documentation: http://youtu.be/LsgcDeVzgE0
CODE:
//code edited from Arduino documentation about motors, h-bridges, and distance sensorsconst int motor1Pin = 9; //back motor
const int motor2Pin = 8; //back motor
const int motor3Pin = 11; //front motor
const int motor4Pin = 10; //front motor
const int enablePin = 7;
const int photocellPin = A0;
int photocellReading;
const int ledPin1 = 5;
const int ledPin2 = 3;

int LEDbrightness;

#define echoPin 13 // Echo Pin
#define trigPin 12 // Trigger Pin
long duration, distance; // Duration used to calculate distance
int minRange = 30; // min range before reverse

void setup() {
Serial.begin(9600);
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(motor3Pin, OUTPUT);
pinMode(motor4Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
pinMode(photocellPin, INPUT);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}

void loop() {

photocellReading = analogRead(photocellPin);
LEDbrightness = constrain(map(photocellReading, 500, 300, 0, 255), 0, 255);
analogWrite(ledPin1, LEDbrightness);
analogWrite(ledPin2, LEDbrightness);

// set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
/* The following trigPin/echoPin cycle is used to determine the
distance of the nearest object by bouncing soundwaves off of it. */
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

digitalWrite(trigPin, HIGH);
delayMicroseconds(10);

digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);

//Calculate the distance (in cm) based on the speed of sound.
distance = duration/58.2;
Serial.println(distance);

if (distance >= minRange){
fwd();
straight();
}
else {
bkwd();
right();
delay(2000);
}
delay(10);

}

void fwd() {
digitalWrite(motor1Pin, LOW);
digitalWrite(motor2Pin, HIGH);
}
void bkwd() {
digitalWrite(motor1Pin, HIGH);
digitalWrite(motor2Pin, LOW);
}
void left() {
digitalWrite(motor3Pin, LOW);
digitalWrite(motor4Pin, HIGH);
}
void right() {
digitalWrite(motor3Pin, HIGH);
digitalWrite(motor4Pin, LOW);
}
void straight() {
digitalWrite(motor3Pin, LOW);
digitalWrite(motor4Pin, LOW);
}

Schematic

Sunglasses

I made some sunglasses that are super useful for when you need protection from bright lights but also need to be able to look down and take notes with clear vision.

I forgot to take photos for documentation though, so I made this video to make up for it.

 

Here is my code: I got parts of it from the arduino and sparkfun tutorials on accelerometers and servos.

 

#include <Wire.h>
#include <SFE_MMA8452Q.h>
#include <Servo.h>

MMA8452Q accel;
Servo right;
Servo left;

int posSL = 0;
int posSR = 180;

void setup()
{
//myservo.attach(10);
right.attach(9);
left.attach(10);

Serial.begin(9600);
accel.init();
}

void loop()
{
if (accel.available())
{

accel.read();

Serial.println(accel.cx);
if (accel.cx >= 0) {
posSR = 180;
posSL = 0;
} else if (accel.cx < 0) {
posSR = 0;
posSL = 180;
}

right.write(posSR);
left.write(posSL);
}
}

Demonic Baby Toy

IMG_20140925_171419782 IMG_20140925_171426322

IMG_20140925_171449560 IMG_20140925_171458413 IMG_20140925_171517436_HDR IMG_20140925_171525590 IMG_20140925_173039229 IMG_20140925_173524906 IMG_20140925_194624990 IMG_20140925_194642550

 

 

For this assignment I used a digital accelerometer with LEDs and a piezo buzzer to make a shaking baby toy.

Based on the accelerometer data, I had the LEDs light up at a certain speed and remapped the speed data to the piezo tone so that at higher speeds it squealed at a higher pitch.

I also learned to solder, and had some fun with the enclosure.

I feel a little bit bad about making this, just a little bit.

LED Music

For the “make something light up” homework, I decided to try and make some LEDs light up with a song.

With the help of an instructables tutorial and the Minim Library in Processing I created a circuit (schematic below), and detected the bass, snare, and hat sounds in a song and had the LEDs light up accordingly.

At the time of this post the Code Snippets thing isn’t working so I will post the code used whenever that is fixed.

CLICK HERE FOR  VIDEO OF LEDS IN ACTION

IMG_20140907_175225Screen Shot 2014-09-07 at 5.50.12 PM

IMG_20140907_173012682

Jessie Contour – Introduction

I feel like making lists:

  1. Born and raised in San Diego, CA
  2. Moved to Boston, MA for undergrad at Northeastern University in 2008. Majored in animation with a specialty in technical animation (rigging, simulation, dynamics), minored in graphic design with a focus on typography.
  3. Graduated in 2013 and have been working in video games ever since.
  4. Moved to NYC, attending Parsons.

Nightmarehit spinner

My main goals in taking PComp include (in no particular order):

  • Making a battlebot
  • Learning about wearable technology
  • Making little arduino-driven light and sound responsive critters with personalities that I can program and/or procedurally generate.
  • I’m sure I will come up with many more things I want to make but I don’t know enough about PComp to think of them yet.