Ellen Sundh: Creative technologist working at Society46 with an interest in new technology, physical interaction and building stuff I gather stuff here. End of message.
2. Once you installed the SDK you can get the latest update from this command-line command by
executing:
tools/android update sdk
3. Install the ADT plugin
- Start Eclipse, then select Help ]]> Install New Software…
- Click on add and the window below will appear. Input the URL https://dl-ssl.google.com/android/eclipse/. Use http if https does not work. Name it “ADT Plugin”.
- Click on Next, and then Next agian and accept the license agreements. Click on Finish.
- Restart Eclipse
4. Create an AVD Manager
- In order to run our Android app on the Mac we need to set up an Android Virtual Device in Eclipse.
Window > AVD Manager
- Create a new AVD by clicking on new
- Type in the name of your avd, in my case my_avd
- Choose a target.
The target is the platform (that is, the version of the Android SDK, such as 2.3.3) you want to run on the emulator. I chose the latest one I got.
- Click create!
The Arduino Ethernet shield has been around for some time now. It’s a great solution for cutting out the middle man of the computer when check things online from the Arduino. In order to build smaller cases I stumbled upon EtherTen from Freetronics. It’s a fully Arduino-compatible board that runs Arduino code AND connects to internet with Ethernet.
Lets make a list of the pros:
- Smaller than Arduino board with Ethernet shield on top
- Runs Arduino Ethernet library
- Power of Ethernet, no power supply needed (!!!!)
- Micro SD card holder
- And sexy round corners (rounder than the Ethernet Shield)
- Neat mini USB socket
When it arrived I simply ran the TwitterClient file by Tom Igoe in Ethernet examples of the Arduino IDE and it was up and running. To call my custom php file was a bit harder though. Example code to be posted on my Arduino Circuit Blog shortly.
At Society 46 we celebrated the Xmas by hooking up to loads of Xmas lights to the node-js module Hydna. People can switch on and off 11 220 V sockets in real-time. Try it out on http://www.society46.com/xmas and turn on the lights of Society 46 Xmas Crib.
I am working on a project where the good old Apple Script is need to do some magic on a Mac computer. Even though it is very semantic it can do some powerful stuff. The result will be posted as soon as it is finished.
Here is a simle Hello World example just to get it up and running in Xcode. The example is used in a Mac OS X application.
#import "S46AppDelegate.h"
@implementation S46AppDelegate
@synthesize window;
-(void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application
NSDictionary* errorDict;
NSAppleEventDescriptor* returnDescriptor = NULL;
if(returnDescriptor != NULL) { // successful execution if(kAENullEvent !=[returnDescriptor descriptorType]) { // script returned an AppleScript result if(cAEList ==[returnDescriptor descriptorType]) { // result is a list of other descriptors } else { // coerce the result to the appropriate ObjC type } } } else { // no script result, handle error here } }
Whenever I make a circuit I try to document it and take photos. With the Fritzing software it gets even better. To share code and circuits I gathered my Arduino circuits on this new blog: Ellen Sundh’s Arduino Circuit Blog
Hi Ellen, can you point me in the right direction of how to order parts for Arduino projects in Sweden? I can only ever find the parts I need from stores that only sell to business… Tack!
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:
Yellow is magnetic heading.
Blue is a compass offset (always following the magnetic heading with a decided offset)
Black is the gyroscope (reset every time the compass is stable)
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.
Compass from Location Manager
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:
#import <UIKit/UIKit.h> #import <math.h> #import <CoreMotion/CoreMotion.h> // For the gyroscope #import <CoreLocation/CoreLocation.h> // 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.
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.
-(void)updater:(NSTimer *)timer { // Om inte compassen rört sig på ett tag kalibrera gyron efter det if(updatedHeading == oldHeading){
NSLog(@"Update gyro");
newCompassTarget =(0 - updatedHeading)+ northOffest;
offsetG = currentYaw;
updateCompass =1; }else{
updateCompass =0; }
oldHeading = updatedHeading; }
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.
Lars Mahnkopf
11:37 on September 23, 2011
Permalink
Hi,
one question about the code above: the radianConst just converts degrees into radians or am i wrong? when will you post your example code? ( I can´t wait to see it )
There are 2 questions
1. Where is the CC_RADIANS_TO_DEGREES function?
2. opQ = [[NSOperationQueuecurrentQueue] retain];
is NSOperationQueuecurrentQueue the normal object in iOS ?
Nick 18:49 on January 1, 2012 Permalink
Hi Ellen, can you point me in the right direction of how to order parts for Arduino projects in Sweden? I can only ever find the parts I need from stores that only sell to business… Tack!
Ellen 13:57 on January 2, 2012 Permalink
Hi Nick! There are several stores in Sweden you can buy Arduino related parts from. The ones I use are: http://www.lawicel-shop.se/, http://www.electrokit.com/, http://www.robotshop.se/
Kjell.com also sell some basic stuff. Good shopping!!
Nick 18:29 on January 3, 2012 Permalink
Grrrr Arrrgh! Absolutely no one has the part I need and don,t feel like paying 250 just for postage…
http://uk.mouser.com/ProductDetail/Microchip-Technology/MCP4921-E-P/?qs=sGAEpiMZZMsUzhEcHltCuTm2oQGScGfw
Nick 11:59 on January 5, 2012 Permalink
Finally! Sweet success thanks to elfa.se
One midi-controlled SX-150 coming up!