Hi Al,

If you check out the chuck examples folder that came in the chuck download or in the "Open Example" menu item, there should be a "serial" subcategory with some basic examples of communicating with serial devices (e.g. Arduino) in there. 

What I would recommend is sending your 5 analog values as a space separated series of ASCII numbers, ending with a newline, and repeating this at whatever your desired refresh rate is. In ChucK, you can use onLine()/getLine() (as in the lines.ck example) to get each line of data, which includes all 5 current sensor values. There is also a (minimally documented) RegEx class you can use to pull out the values individually and then convert them to integers. 

Ive also attached another ChucK example I have that does something very similar to this, except it reads only 3 sensor values and uses commas to separate values. 

Thats a lot of stuff, so let us know if you have any more questions.  

spencer



On Wed, Jan 1, 2014 at 9:59 AM, Alan Brooker <alan.brooker2010@gmail.com> wrote:
Hi there

I am using ChucK 1.3.2.0 (Chimera) with miniAudicle 1.3.0a on Ubuntu 12.04- I think the latest version can communicate with Arduino directly?  Cant seem to find any examples so any advice  or example code would be much appreciated. I am trying to build a simple step sequencer with x5 potentiometers that send values to an arduino board and then into ChucK hopefully. Was hoping I could do this without OSC-

thanks for helping this noob!



Al

_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users