The latest work from Society46 where the iPhones turns into a tool to paint together with other, in real time with the help of Hydna real-time server.
CO:CREATE from Society 46 on Vimeo.

The latest work from Society46 where the iPhones turns into a tool to paint together with other, in real time with the help of Hydna real-time server.
CO:CREATE from Society 46 on Vimeo.
During the Arduino Workshop with Geek Girls Meetup we went through a number of sensors. A full list will be posted here soon. Here are some images from the workshop:


Some robots only reacts on very dirty words. It’s a struggle but what could you do. This robot reacts on Swedish dirty words (genitals and poo related words).
How is it possible to detect the rotation of an iPhone that lies on a table like the compass but is showing a more accurate rotation? I tried to use the compass with the magnetic heading of the iPhone but it appears to be quite unreliable and jumps unexpectedly. The gyroscope can be used but the original reference point drifts with the gyroscope over time. This example combines the compass and the gyroscope using the compass as a reference as long as it is stable and using the fast update of the gyroscope between the times the compass is unstable.
In the app below there are 3 rotating graphics:
The application uses the CLLocationManager to access the magnetic heading of the compass and CMMotionManager to access the gyroscope. The values I use are newHeading.magneticHeading and motion.attitude.yaw. The magnetic heading gives a value of 360 degrees. The yaw value gives a value between -180 and 180.
First we initialize the location manager. This will only work on the device and not in the simulator.
As shown in the code above we delegate the listener to RotationViewController. The following code is needed to listen to updates for the compass:
Next step is to listen to updates from the gyroscope. We do that by listening to motionManager’s CMAttitude updates. We use the yaw which is retrieved in radians and we convert it to degrees.
[motionManager release];
}
[motionManagerstartDeviceMotionUpdatesToQueue:opQwithHandler:motionHandler];
We now have the compass and the gyroscope. In this example I wanted to offset the magnetic heading so it always points at a certain direction. I decide on that direction when I press the “Calibrate”-button I set my offset from the magnetic heading. updatedHeading is the latest magnetic heading I got from the locationManager. northOffset becomes my reference to where I want the gyroscope to always origin from.
Now that we have the northOffset we want to use it together with the gyroscope. Since the compass is jumping sometimes we want to only use the compass value when it is stable. A timer is created with the updater method that checks if the value of the magnetic heading has changed. The interval is called every other second. If the magnetic heading hasn’t changed from last time it is considered a stable value. The stable value is added to newCompassTarget which is use for the gyroscope to get a new reference.
newCompassTarget is used in the code below so that the gyroscope always strive to go to the new reference of the compass but with the offset we use in the variable offsetG which is the difference between where the gyroscope was with the old and compared to the new heading.
} else {
rotateImg.transform = CGAffineTransformMakeRotation(gyroDegrees);
}
};
Download project source code here.
Recently I started using the neat fetures of Fmod for iPhone development. Fmod is an audio library used for most gaming platforms to add sound effects and create a 3D world of sounds. Here follows a step-by-step guide to set up Fmod for iPhone in Xcode. SDK version 4.3.3.
1. Download Fmod Ex Programmers API for iOS.
2. Unzip Fmod Programmers API to your Applications folder.
3. Create a new project in xCode. To enhance the workflow I create my project in the following folder: “/Applications/FMOD Programmers API/examples/”.
4. Fmod is using a mix of Objective-C and C++. All .m files in your project needs to be renamed .mm which is the file format for Objective-C++.
5. In “Build Phases” link the following frameworks to your project:
AudioToolbox.framework
CoreAudio.framework
6. Include these Fmod files in your header file:
7. For your project to find the Fmod files you will include search paths to your “Build settings”:
8. Link the following libraries to your project. In “Build Settings” set OTHER_LDFLAGS to:
I just downloaded a sample project to test FMOD and got the error:
After a lot of googling I finally did the “magic combination” (Xcode 3.2.6). As a note for myself and as a solution for you, here are the steps:
1. In the “Groups & Files” column, expand folder “Targets”. Right-click on your app-name that is inclosed here.
2. Select “Get Info”
3. Select “Build” tab
4. In the search field, search on “Base SDK”.
5. Click on the text (in my case “iOS 3.1.2 (missing)”) and select your desired iOS.
6. Close window and you should now be able to build your project.
Some experience this problem as a bug in their Xcode version and got the advice to toggle between “Debug” and “Release” to get it to work. And Restart Xcode have helped others.
Inspiring times at this year’s Geek Girl Meetup in Stockholm. See my session on Input / Output – Creative technology with electronics where I demo some of my projects. Only in Swedish :-/
My first test of controlling the Arduino outputs from an iPhone app. I use the firmware for Arduino and a Processing script checking if the light is on or off and sending the info to the Arduino board and the lamp. Code will soon see the light here.
I soldered together a Wave Shield 1.0 to be fit on the Arudino. There is a version 1.1 so if you follow the solering instructions make sure you look at the right one. Version 1.1 differs in components and placement of them. The Wave Shield can play Wave files stored on the SD card. The SD card needs to be in FAT16 format. The Wave files must be saved in mono, 22KHz, 16-bit. Audacity is a very nifty and free audio software for Mac, Linux and Windows to convert and record sounds in mono.
There are several libraries build to support the shield. The example below is using the older AF_Wave library while there is a newer library called WaveHC.
The following code prints out the sensor value in Serial Monitor and plays a sound if the value of the flex sensor is less than 600:
You can view the enitre Arudino source code here
I want to use the muscles of Processing to get my Arduino do really cool stuff. In order to do this I want both of the softwares to talk to each other. It proves to be a bumpy road depending on versions of you Arduino board and processing. My set up is a Mac OS X 10.6.7, Arduino board Duemilanove with Atmega328. If you already have the Arduino and Processing software installed do the following:
1. Download the Processing library, unzip it.
2. Put the folder “arduino” inside a folder that you call “libraries” within your Processing Sketchbook folder.
3. Connect your Arduino board and open up the Arduino software, upload the sketch StandardFirmata from Examples/Firmata. Close Arduino software.
4. Add a LED diod to pins Ground and 13 on the Arduino board and run the following code in Processing:
Arduino arduino;
int ledPin = 13;
void setup()
{
//println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 57600);
arduino.pinMode(ledPin, Arduino.OUTPUT);
}
void draw()
{
arduino.digitalWrite(ledPin, Arduino.HIGH);
delay(1000);
arduino.digitalWrite(ledPin, Arduino.LOW);
delay(1000);
}
Whoohooo!!!! You should now see your LED blinking on and off.
Mismatch of RXTX libraries
When running your Processing sketch the following error can occur:
1. Download the latest RXTX library from http://rxtx.qbang.org/
2. Find the files librxtxSerial.jnilib and RXTXcomm.jar in the unzipped folder structure: MACOSX_IDE/ForPackageMaker/Install/Java/Extensions
3. Copy the 2 files into the folder: Harddrive/Library/Java/Extensions
4. Close down Processing and right-click on the application in the “Applications”-folder and select “Show Package Contents”. Go to folder “Contents/Resources/Java/modes/java/libraries/serial/library”. Replace the old RXTXcomm.jar with the new file in this folder.
5. Replace the file librxtxSerial.jnilib with the new file in the “macosx” folder “Contents/Resources/Java/modes/java/libraries/serial/library/macosx”.
6. In order for this to work properly also follow these steps taken from here:
1. Under Finder click on the “Go” Menu
2. Select “Go to Folder…”
3. Type “/var/”
4. Finder will open var folder.
5. Right click on folder named “lock” and select “Get info”
6. Open drop arrow titled “Sharing & Permissions”
7. I set all privileges to: “Read & Write”
8. Close Info
9. Go to the Var folder on the finder and open the “spool” folder
10. Right click on folder named “uucp” and select “Get info”
11. Open drop arrow titled “Sharing & Permissions”
12. I set all privileges to: “Read & Write”
13. Close Info
14. DONE
7. Restart your computer and Processing. The output you should see is:
RXTX Warning
If you got this warning. Make sure you went trough the entire step 6 in the previous block and that the user you are logged in as have the permissions to read & write on these files.