Saturday, March 19, 2011

My First Chumby Widget

So here is my first Chumby Widget:

This is some pretty simple Actionscript. Now, to try to use XML sockets, this Actionscript appears to work:

var xmlSocket:XMLSocket=new XMLSocket();
xmlSocket.onConnect=function() {
xmlSocket.send(new XML("Hello, World!"));
xmlSocket.onXML=function(myXML) {

And on the python side:

>>> from socket import *
>>> s=socket(AF_INET,SOCK_STREAM)
>>> s.bind(('localhost',6666))
>>> s.listen(1)
>>> conn,addr=s.accept()
>>> conn.recv(1024)
'Hello, World!\x00'

Now I just need to have the Chumby widget XML socket messages control Firmata transmissions to contol the Arduino.

Followup: Well, the Actionscript and Python worked fine on my laptop, but a Chumby Widget needs a proper "crossdomain.xml" served out for the pair to work...see the next post!

No comments: