Show Posts
Pages: 1 2 3 [4] 5 6 ... 25
46  Forum 2005-2010 (read only) / Interfacing / Re: Sending RGB values to Arduino from Processing on: August 27, 2008, 06:06:43 pm
I guess that's due to the fact that maybe the arduino do not receives the values as int but as ascii characters.

In fact, this pb happens a lot. In the arduino sketches, wen you do
Code:
int value = 256;
Serial.print(value);
You're not really sending the number 256, but the ascii code for the three characters 2, 5 and 6, in this case 50,53,54. To send the real "value" of the variable, you have to define in which format you send it.
Code:
int value = 256;
Serial.print(value, INT);
This way, you're sending an integer. this can work with other type of variables (BYTE, etc..., check arduino reference)

I'm no pro at processing, but when you do you myPort.write(r/g/b/led), try to do something like myPort.write(r/g/b/led, int). Not sure the syntax (value, int) will work though. Check processing manual.
47  Forum 2005-2010 (read only) / Interfacing / Re: Serial interfacing problem on: August 09, 2008, 04:21:53 pm
Are you trying to use the port_in / port_out function in the Script Editor ?
This might be really difficult to use, are you're using the I/O ports on your computer, and I must say the list is quite long and can result in some reaaaly bad stuff if you write to the wrong port...
Here's a list of all the I/O ports if you still want to try it ^^
http://bochs.sourceforge.net/techspec/PORTS.LST

My guess would be that you'd better use a .dll
For instance, the System.IO.Ports.SerialPort class is part of the System.dll you find on every computer with Windows...
Search for the API and dll_open sections in the Script Editor help.
48  Forum 2005-2010 (read only) / Interfacing / Re: Serial interfacing problem on: August 08, 2008, 07:41:06 pm
What programming language are you using ?
49  Forum 2005-2010 (read only) / Interfacing / Re: Using Arduino Libraries w/ Processing? on: July 30, 2008, 01:42:03 pm
Yep, you can use processing to talk with the arduino via the serial port.
Check the playground, I guess there are a lot of examples of how to do it.

A simple way :

Code:
import processing.serial.*;
Serial myPort;                // The serial port

int BAUDRATE = 115200;

void setup()
{
  size(100,100);
  background(0);
  myPort = new Serial(this, Serial.list()[0], BAUDRATE);
  myPort.clear();
}

http://processing.org/reference/libraries/serial/index.html
50  Forum 2005-2010 (read only) / Interfacing / Re: Arduino working with a program i build on: July 30, 2008, 01:38:08 pm
I guess the most simple way is to use .net serial port object.
Is pretty easy to use. I don't have a C working code, but I used the .net serial object in 3DSMAX using maxscript and there was no pb reading the serial port.
51  Forum 2005-2010 (read only) / Interfacing / Re: Send sketch to arduino with python on: July 12, 2008, 08:58:20 am
I'm pretty sure you can't. The python script arduino_serial.py is used to talk with a sketch running on the Arduino, not to burn a compiled sketch on the chip.
52  Forum 2005-2010 (read only) / Interfacing / Re: Arduino 0011 but other AVR chip ??? on: July 07, 2008, 01:27:21 am
I'va always had troubles really understanding the utility of the bootloader. Is it only necessary for burning sketches using the arduino IDE ? Can I burn blank ATmega168 using an ICSP programmer with a program wrote with the arduino IDE (hex compiled file) without having to burn the bootloader on those chips ?
Or does the bootloader have to be included on the chips to be able to interpret a sketch running on the ATmega168 (burned via ICSP or arduino board/IDE) ?
53  Forum 2005-2010 (read only) / Interfacing / Re: Lilypad light sensor maxuino on: June 17, 2008, 04:42:47 pm
The max patch above was made for a particular use. I send a message to the arduino, the arduino reads the sensor from an optical mouse and sends me 324 values, with a println between each value.
The patch takes this data, converts the ASCII (it's in ascii because I use simple Serial.print(value)smiley-wink into integers by using the println ascii equivalent (13) to separate each data. It then puts all this data in a list of 324 elements, etc.... but that's just max giberrish after that ^^
54  Forum 2005-2010 (read only) / Interfacing / Re: Lilypad light sensor maxuino on: June 16, 2008, 10:18:11 pm
Sorry, I don't know if it's new, just tested it and worked ^^
I'm pretty new with max/msp
55  Forum 2005-2010 (read only) / Interfacing / Re: Lilypad light sensor maxuino on: June 16, 2008, 04:27:31 am
I hade the same kind of pb hooking up an Arduino with max/msp. My problem was because the arduino was sending something like
Serial.print(12), and I was receiving odd values on the other side.
In fact, the arduino was sending this as ASCII values, so 1 = 49, 2 = 50 > 12 = 49 50.
After reading the help, I came with this patch

You just have to modify a little your arduino code by adding a Serial.println() after each value.
The orange box is used to reconvert ASCII to integers.

With this kind of patch, you don't need to use maxuimo, firmata or whatever, just make your code, and you don't need to use the max patches made for those firmware, just your regular max/msp patch.
56  Forum 2005-2010 (read only) / Interfacing / Re: Start.begin() max speed on: June 12, 2008, 03:53:20 am
Thanks bens, I'll check the datasheet toroughly and will order some more ATMega168 chips ^^
57  Forum 2005-2010 (read only) / Interfacing / Start.begin() max speed on: June 12, 2008, 02:29:19 am
Hi there.
I was just wondering : what maximum speed can you use safely with the Serial.begin() syntax ? In the reference, it says that 115200 is the "popular" maximum, but i'm working on something that might need a lot more speed. I just ran a test sketch with 3 times that (345600 bps) and it seems to work ok, but what can I expect to lose with such high speed ? Couldn't find any info about that on any datasheet.
Why so much speed : http://play-collective.net/blog/archives/26
Cheers
58  Forum 2005-2010 (read only) / Interfacing / Re: Engraving Software on: February 21, 2008, 05:12:37 pm
I just saw that the RepRap project is working with an Arduino board, and that they got a G-code intepreter Sketch. I'll try to look this way ^^
59  Forum 2005-2010 (read only) / Interfacing / Engraving Software on: February 10, 2008, 09:15:56 pm
Hi there
I searched quickly but i did not find any answer
I don't know if you remember the project hector.ch. They used Scriptographer to output routing path from Illustrator and to control a specific hardware
Do you know any software that can make the same kind of thing, let's say read a particularly colored .eps file (like the ones you produce for ponoko) and output a txt file that can be read and translated in Processing (for exemple) to drive some stepper motors?
I'm just in a reflexion phase, I don't yet know how I'm gonna build my engraving thingy but I'd like to be sure I can draw paths easily without having to code every movement by hand ^^
Thanks

melka
60  Forum 2005-2010 (read only) / Development / Re: Library for TLC5940 16-channel PWM chip on: August 20, 2008, 02:43:31 pm
sooo many thanks ^^
Pages: 1 2 3 [4] 5 6 ... 25