Wednesday, January 20, 2010

Connecting to a Pebble

I came into this room with a jillion people soldering and just finishing their Arduino pebble thingies and some madman crouched by my wheelchair to explain how to mindmeld with it. After a bunch of fiddling and more kibbitzing by a guy named Garth we got this other one working. I am incoherent! Because jetlag, and I'm in New Zealand at day something of linux.conf.au.

Pebble!

Here's how to do it! On a mac! Incoherently! And not quite like this, which is full of lies.

download arduino software
download drivers

You will have to restart your Mac.

download source of Aiko from github. (You do not need to go figure out github right now, just click on "download source")

move that into ~/Documents/Arduino and unzip it.

It needs to be like this:

docs/ nursery/
aiko_gateway/ examples/ pebble/
aiko_node/ libraries/ tests/

And in:

~/Documents/Arduino/libraries:

Aiko/ PString/ pebble_relays/
NewSoftSerial/ PString2.zip pebble_relays_aiko/
NewSoftSerial10c.zip pebble/ pebble_temperature/
OneWire/ pebble_display/
OneWire.zip pebble_ldr/



And thusly:

~/Documents/Arduino/libraries/Aiko:


AikoCallback.h* AikoDeviceSPIBus.h* AikoSExpression.h*
AikoDeviceMCP320x.cpp* AikoEvents.cpp* AikoTiming.cpp*
AikoDeviceMCP320x.h* AikoEvents.h* AikoTiming.h*
AikoDeviceSPIBus.cpp* AikoSExpression.cpp* Makefile*

You will be missing a bunch those files and the might not be in the right place. So move them around!


Download and unzip into ~Documents/Arduino/libraries:

http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip

http://arduiniana.org/NewSoftSerial/NewSoftSerial10c.zip

http://arduiniana.org/PString/PString2.zip


Then plug in your Pebble! Yay!

Open Arduino application which you downloaaded earlier.

Select the Serial Port from the Tools menu.

Go to File--- Sketchbook -- aiko_node

Click Verify in the button toolbar

It should compile

Click the upload button in the toolbar

It turns on! yay!

Make sure to select the serial port in "Tools".
Click the Serial monitor button in the toolbar. It pops up another window.

select 38400 baud in the dropdown menu

Your Pebble should talk to you now!

thusly:

(node pebble_1 ? (temperature 27.87 C))
(node pebble_1 ? )
(node pebble_1 ? (light_lux 854 lux))
(node pebble_1 ? )
(node pebble_1 ? (light_lux 854 lux))
(node pebble_1 ? (temperature 27.87 C))
(node pebble_1 ? )
(node pebble_1 ? (light_lux 855 lux))
(node pebble_1 ? )

Tell it this:

(relay on);
(relay off);
(relay2 on);
(reset_clock);

You have now Impressed the Pebble. Name it something like R'duinoth. Huzzah!

aiko says hi!

Digg this

2 comments:

Benno said...

If you want to make friends with the people at the airport, you can try this patch.

Liz said...

Benno, hilarious!

More links:

http://groups.google.com/group/aiko-platform

http://en.wikipedia.org/wiki/Processing_%28programming_language%29