Show Posts
Pages: [1] 2 3 ... 15
1  Using Arduino / Interfacing w/ Software on the Computer / Re: arduino2max using MEGA 2560 problem on: April 09, 2013, 11:23:35 pm
PS: you will have to change the MAX patch end also for a MEGA version.
There's a "zl group" Object that might have to be bigger, and also the "route list" at the bottom of the patch will have to be wider.

2  Using Arduino / Interfacing w/ Software on the Computer / Re: arduino2max using MEGA 2560 problem on: April 09, 2013, 11:21:11 pm

The old version (v .5) of Arduino2Max didn't work with the Uno because the the command to print byte values had changed. I just got around to uploading a newer version (v .6 November 2012) that works with Uno.
See the playground.

3  Using Arduino / Programming Questions / Re: Leonardo baud rate for USB CDC on: November 14, 2012, 03:05:06 pm
Thanks for the clarification!

The documentation on serial ports fir the Leonardo is a bit lacking.

When you open the serial monitor, and are monitoring the USB(CDC) connection, does the baud rate pulldown have any effect?

4  Using Arduino / Project Guidance / Re: Arduino2Max Problems on: November 13, 2012, 10:57:51 pm
I wrote that Arduino2Max code package about five years ago.. It's amazing that people are still using it!

If you're reading this, and know how to code, fix it up and I'll release it as a new version. Otherwise, I'll just enjoy watching.

5  Using Arduino / Programming Questions / Re: Leonardo baud rate for USB CDC on: November 13, 2012, 10:38:51 pm
I found this interesting:

It's not necessary to call Serial.begin() for the Leonardo since the CDC device is initialized elsewhere.  The stub was retained for backwards-compatibility. 

.. since it seems to say that the serial speed for the USB CDC is independent of whatever code you write. I'm inferring that since you don't need to open the port with a speed (e.g. Serial.begin(115200))

Does that sound right?

Which leads me to my second question:

Q: Is the serial monitor in the Arduino IDE monitoring the USB CDC serial port or the hardware serial port?

Thanks for any insights!

6  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Hard to find specs on the Arduino NG on: May 26, 2008, 12:16:04 am
We are condemned to repeat the answers to questions like these. It's a sort of Zen mediation practice.

Arduino input./outputs operate in the 0-5V range.
You can source or sink a maximum of about 40ma through each pin, but stick to 20ma.
The voltage regulator will indeed take 25 or 30V, but at currents in excess of 100ma or so, you will be dissipating P=EI=20V * .1A= 2Watts, which will be very hot. ( All calculations are based on my popular science engineering degree.)


7  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: speed as reserved word on: April 29, 2008, 09:04:18 pm
thanks David!

8  Forum 2005-2010 (read only) / Bugs & Suggestions / speed as reserved word on: April 29, 2008, 05:23:24 pm
out of curiosity, why  is "speed" a reserved word in the Arduino software?

9  Forum 2005-2010 (read only) / Syntax & Programs / Re: MaxSonar EZ0 Problems on: February 07, 2009, 04:07:53 pm
I've used those sensors plenty and they work well.

The problem is probably something to do with where you have it positioned: if there is anything in the beam path of the sensor, it will reflect back. If it's on a table for example, the tabletop will reflect back the Ultrasound and it will appear to only read to 20 inches.

To troubleshoot this, I would connect a voltmeter to the analog output, and then position the sensor so that you get the full output range. After that I would just use analogRead() to get the sensor value.

10  Forum 2005-2010 (read only) / Syntax & Programs / Re: DC motor motion control fine tuning (help!! ;- on: June 26, 2008, 07:37:28 pm
If you run out of energy there is always this... not open source, but provided very cheaply as a commercial alternative.
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: bits n' bytes n' wire length on: May 05, 2008, 11:23:17 pm
PS this comes up on Google. With this, you could program from the Starbucks next door. You'd have to explain the ethernet cable though.
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: bits n' bytes n' wire length on: May 05, 2008, 11:19:43 pm
hmm.. sounds like asking for trouble, since AC dimmers chop the AC line and make lots of noise. I would say avoid any extensions on the SR lines- nothing more than a foot is really a good idea. Ideally digital logic lines are as short as possible.  At 14' you have a bunch of antennas that are going to pick up noise in that terrifically noisy environment,  not to mention the fact that the inductance of the wires will have some effect on the response of the signals. I would say avoid at all costs, just to save yourself the headaches. If you have to do it, then use shielded cables.

The USB protocol page says you can use a 5M cable:

Q1:  How long of a cable can I use to connect my device?
A1: In practice, the USB specification limits the length of a cable between full speed devices to 5 meters (a little under 16 feet 5 inches). For a low speed device the limit is 3 meters (9 feet 10 inches).

Another option would be using Xbee modules as a serial extender, or Ladyada's Ethernet shield.  

13  Forum 2005-2010 (read only) / Syntax & Programs / concatenate print statements on: May 05, 2008, 10:59:26 pm
Does anyone know if there is a way to concatenate print statements so you can have a string and a variable in a single Serial.print() statement?

I was wondering if there is something like what they have in Php:    <?php echo "hello" . $name ?>

14  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial char and int confusion on: May 04, 2008, 02:20:41 pm
here's what I ended up with. This sends motor commands via Software serial, and receives the response over hardware serial.

Calling getPosition() returns a long with the exact motor position:


long position = 0;

long  getMotorPosition(){
  blinkStatusLed(2, 40);                      // blink status led
  Serial.flush();                                  // clear junk from hardware serial port
  bytesread = 0;                                // zero the variables for the serial read
  motorSerial.println("ZS");                // tell motor to ignore internal errors
  motorSerial.println("RP");                   // ask motor to report its position "RP"
 delay (10);                                                // wait for the 128 byte hardware serial buffer to fill up a bit

  while (Serial.available() > 0 )  {                 // while there is data in the hardware serial buffer
    currentPos[bytesread] =;     //  read a byte

if (currentPos[bytesread]==13){                  // escape if end of data CR
    bytesread= bytesread - 1;                       // decrement array if last number is CR (13)

    bytesread= bytesread +1;                               // ready to read next digit of position, increment array pointer
position = 0;
    for (int pointer= 0; pointer<= bytesread; pointer++){   // reconstruct the position as long
  position = (position * 10) + (currentPos[pointer] - 48 );

return position;

15  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial char and int confusion on: May 03, 2008, 02:55:23 am
thanks everyone....

as it turns out, the numbers above weren't coming as a result of a request. I had programmed the motor own internal processor to spit them out. Then the software serial would catch them in an odd order and geenrate all that junk. That was problem one.

Problem 2 was that instead of sending "ZS RP" (reset errors, report position), I was sending (of course) "ZSRP" and the motor wasnt recognizing the report  position command.

Now I get a nice stream of position reports! Super accurate: here's 1 RPM rotation over a couple of seconds:

One handy thing I did discover is that you can put a KeySpan USA19 serial adapter on the spare USB port of your computer, run ZTERM and use the Keyspan's RS232 receive pin as a probe to watch what's being sent!

thanks again

Pages: [1] 2 3 ... 15