Lines take two.

Must get bigger motor and perhaps different gear ratios for the next go round.

Lines… First iteration

I used the most basic hobby servo and the example sketch to make some bamboo move.

MPU/GY-521 Playtime cont

MPU6050 / GY-521 playtime

I have been looking at using the accelorometer/gyro for an input sensor as part of a performance collaboration. The sensors will be used to interpret the hip movements of a dancer into triggers or modifiers for sounds.

Today with the help of fellow student Kina Smith I finally made some of the values useful… I need to look into using them attached to a person and eventually incorporate the gyroscope to the code.

I am importing the code into processing for the moment to experiment with the data.

Processing code derived from Igoe’s example on Serial:

import processing.serial.*;
int lf = 10; // Linefeed in ASCII
Serial myPort; // The serial port:
String myString = null;

void setup() {
// List all the available serial ports:
println(Serial.list());
// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[5], 38400);
}

void draw() {
while (myPort.available () > 0) {
myString = myPort.readStringUntil(lf);
if (myString != null) {
}
}
int[] nums = int(split(myString,’,’));
//println(nums[0]);
//println (nums[1]);
//println (nums[2]);
float x = map(nums[0],-17000, 17000,-10,10);
float y= map(nums[1],-17000, 17000,-10,10);
float z=map(nums[2],-17000, 17000,-10,10);
println(x,y,z);

}

Ardunio code I hacked away at from an example for the MPU6050:

// I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class
// 10/7/2011 by Jeff Rowberg <jeff@rowberg.net>
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2013-05-08 - added multiple output formats
// - added seamless Fastwire support
// 2011-10-07 - initial release

/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2011 Jeff Rowberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================
*/

// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include “I2Cdev.h”
#include “MPU6050.h”

// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include “Wire.h”
#endif

// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 accelgyro;
//MPU6050 accelgyro(0x69); // <— use for AD0 high

int16_t ax, ay, az;
int16_t gx, gy, gz;

// uncomment “OUTPUT_READABLE_ACCELGYRO” if you want to see a tab-separated
// list of the accel X/Y/Z and then gyro X/Y/Z values in decimal. Easy to read,
// not so easy to parse, and slow(er) over UART.
#define OUTPUT_READABLE_ACCELGYRO

// uncomment “OUTPUT_BINARY_ACCELGYRO” to send all 6 axes of data as 16-bit
// binary, one right after the other. This is very fast (as fast as possible
// without compression or data loss), and easy to parse, but impossible to read
// for a human.
//#define OUTPUT_BINARY_ACCELGYRO


#define LED_PIN 13
bool blinkState = false;

void setup() {
// join I2C bus (I2Cdev library doesn’t do this automatically)
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endif

// initialize serial communication
// (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
// it’s really up to you depending on your project)
Serial.begin(38400);

// initialize device
Serial.println(“Initializing I2C devices…”);
accelgyro.initialize();

// verify connection
Serial.println(“Testing device connections…”);
Serial.println(accelgyro.testConnection() ? “MPU6050 connection successful” : “MPU6050 connection failed”);

// use the code below to change accel/gyro offset values
/*
Serial.println(“Updating internal sensor offsets…”);
// -76 -2359 1688 0 0 0
Serial.print(accelgyro.getXAccelOffset()); Serial.print(“\t”); // -76
Serial.print(accelgyro.getYAccelOffset()); Serial.print(“\t”); // -2359
Serial.print(accelgyro.getZAccelOffset()); Serial.print(“\t”); // 1688
Serial.print(accelgyro.getXGyroOffset()); Serial.print(“\t”); // 0
Serial.print(accelgyro.getYGyroOffset()); Serial.print(“\t”); // 0
Serial.print(accelgyro.getZGyroOffset()); Serial.print(“\t”); // 0
Serial.print(“\n”);
accelgyro.setXGyroOffset(220);
accelgyro.setYGyroOffset(76);
accelgyro.setZGyroOffset(-85);
Serial.print(accelgyro.getXAccelOffset()); Serial.print(“\t”); // -76
Serial.print(accelgyro.getYAccelOffset()); Serial.print(“\t”); // -2359
Serial.print(accelgyro.getZAccelOffset()); Serial.print(“\t”); // 1688
Serial.print(accelgyro.getXGyroOffset()); Serial.print(“\t”); // 0
Serial.print(accelgyro.getYGyroOffset()); Serial.print(“\t”); // 0
Serial.print(accelgyro.getZGyroOffset()); Serial.print(“\t”); // 0
Serial.print(“\n”);
*/

// configure Arduino LED for
pinMode(LED_PIN, OUTPUT);
}

void loop() {
// read raw accel/gyro measurements from device
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

// these methods (and a few others) are also available
//accelgyro.getAcceleration(&ax, &ay, &az);
//accelgyro.getRotation(&gx, &gy, &gz);

//#ifdef OUTPUT_READABLE_ACCELGYRO
// display tab-separated accel/gyro x/y/z values
// Serial.print(“a/g:\t”);
Serial.print(ax); Serial.print(“,”);
Serial.print(ay); Serial.print(“,”);
Serial.print(az); Serial.print(“,”);
Serial.println();
delay(10);
/* Serial.print(gx); Serial.print(“\t”);
Serial.print(gy); Serial.print(“\t”);
Serial.println(gz);
#endif

#ifdef OUTPUT_BINARY_ACCELGYRO
Serial.write((uint8_t)(ax » 8)); Serial.write((uint8_t)(ax & 0xFF));
Serial.write((uint8_t)(ay » 8)); Serial.write((uint8_t)(ay & 0xFF));
Serial.write((uint8_t)(az » 8)); Serial.write((uint8_t)(az & 0xFF));
Serial.write((uint8_t)(gx » 8)); Serial.write((uint8_t)(gx & 0xFF));
Serial.write((uint8_t)(gy » 8)); Serial.write((uint8_t)(gy & 0xFF));
Serial.write((uint8_t)(gz » 8)); Serial.write((uint8_t)(gz & 0xFF));
#endif*/

// blink LED to indicate activity
blinkState = !blinkState;
digitalWrite(LED_PIN, blinkState);
}

Reblogged from flourlamb  2 notes

Switches

flourlamb:

Here I added a button that controls the LED. I powered the circuit with my computer using a USB connection to an Arduino. The red and black leads send electricity from the Arduino to the breadboard. The current travels through the voltage regulator and the resistor to the LED, but only if the button is pressed.

Helping make LEDs light up

What is physical Interactivity?

Dear internet,

Merry-go-rounds, I loved them! As a child I tried my hardest to spin the merry-go-round so fast I could get my friends to fly off and inturn they would do the same for me.  We would explore different positions for generating momentum. We tried running around each holding on to a bar, then jumping on. We never successfully freed another child from the cage of the merry-go-round, but our exploration in how we might accomplish our goal was enough to motivate continual play.

The visceral play I experienced as a child is my ideal interactivity. This can at times manifest in a abnormally gratifying button press, most often I find it in the unexpected. When a device asks you to do something different, like, the subway terminals that let you to do squats as payment. Not to say that all physical interaction has to be a leg workout, but something that can take you out of your head and finger and into your body.

Interactivity has become ubiquitous making our expectations for it higher now than 20 years ago. We now expect things to beep and blink at us as we use an ATM, browse the web, play games, ect ect. Does this ubiquity mean that a gratifying experience has to be over the top with digital whirlygigs and doodads? I hope not…I want to find ways to create visceral interactions using unexpected manifestations of technology.

Thanks for reading.

T