monome: community
news
events
applications
projects
hardware
arduinome
help
trade
ioflow
movie
open
not signed in (sign in / register)
Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
-
- CommentAuthormarcman220
- CommentTimeJul 24th 2009 edited
Attached is a small library which can easily control all the serial functions of the Arduinome via python it has only been tested in Linux environments.
My initial goal was to make a full serial program. I still have the same goal, but SimpleOSC seemed to consume an uneasy amount of resources.
Analog input is not supported yet...but in theory you should be able to easily extract data from any USB device!
I hope this helps some people out.
Documentation:
This is more or less a direct translation of the serial protocol. See: http://docs.monome.org/doku.php?id=tech:protocol:40h
for hints.
The only external library required is pySerial and most likely you already have it!
Demo:
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from arduinome import Arduinome
>>> a = Arduinome("/dev/ttyUSB0")
>>>#Lets get the input...this should always be performed in loops!
>>> while 1: a.read()
...
[5, 3, 1]
[4, 3, 1]
[6, 3, 1]
[6, 3, 0]
[5, 3, 0]
...
>>>#Lets turn the first LED on...
>>> a.led(0,0,1)
The read function must be called in an external loop otherwise funky stuff tends to happen.
Cable Position is supported the Left Right Up Down thing seemed a little illogical to me. Play with the variables invert x, invert y, and rotation you will like it.
Also attached is the less stable devicerouter.py this was a framework of sorts for integrating OSC. Sadly I didn't have such great luck efficiently handling OSC messages using simpleOSC.
You can connect multiple arduinomes and stitch them together much like you would with Arduinoserial.
lets have some fun...
>>> from arduinome import Arduinome
>>> from devicerouter import DeviceRouter
>>> d = DeviceRouter()
>>> d.appendDevice(Arduinome("/dev/ttyUSB0"))
>>> d.appendDevice(Arduinome("/dev/ttyUSB1")) #want to use a 40h/64/128/256 it is easy just modify the Arduinome file to suit your protocol.
>>> d.device[1].x=8 #this will make a 128 of sorts, if x = the default 0 the output/input would be the same! Neat.
>>> d.setrow("/monome", 0, [255,255]) #Set all 16 leds in the first row on!
>>> d.setled("/monome", 15,1,1) -
-
CommentAuthorjul
- CommentTimeJul 24th 2009
Hello,
How about using serial-pyio? There is now a tutorial to make python applications for the monome (including arduinome). I added a bit of doc there to fetch the code: http://docs.monome.org/doku.php?id=app:serial-pyio . Development version supports the arduinome.
You have a python tutorial in the src/examples/ directory. This will show you how to make applications, including OSC apps. Let me know if you need some help.
If you will, you can also help us to develop serial-pyio.
Cheers,
Jul -