Show Posts
Pages: 1 [2]
16  Forum 2005-2010 (read only) / Interfacing / Re: Strangeness with Serial and pololu on: October 21, 2010, 07:47:52 am
The user's guide for the pololu is here:

http://www.pololu.com/file/0J37/ssc03a_guide.pdf

My code is straightforward - here's my setup function:

void setup()
{
      Serial.begin(9600);
}

And the commands to control the servo take place here:

void servoSet(int servo, int angle)
{
      unsigned char buff[6];

      unsigned int temp;
      unsigned char pos_hi,pos_low;

      temp = angle & 0x1f80;
      pos_hi = temp >> 7;
      pos_low = angle & 0x7f;

      buff[0] = 0x80; //start byte
      buff[1] = 0x01; //device id
      buff[2] = 0x04; //command number
      buff[3] = servo; //servo number
      buff[4] = pos_hi; //data1
      buff[5] = pos_low; //data2

      for(int i = 0; i < 6; i++) Serial.print(buff, BYTE);
}

And so a call to servoSet sets the position of the servo.

As stated, all works fine as long as a terminal connection has been connected briefly.

There is a possibly similar thread here, but it doesn't address my issue:

http://forum.pololu.com/viewtopic.php?t=745
17  Forum 2005-2010 (read only) / Interfacing / Re: Strangeness with Serial and pololu on: October 20, 2010, 08:38:17 pm
Hello- I have 5v power supply- it doesn't seem to be power related, as it works with just the 5v supply.

The weird part is that the terminal program needs to be connected to serial, if only briefly- it can be disconnected and the servos continue to work.

b...
18  Forum 2005-2010 (read only) / Interfacing / Strangeness with Serial and pololu on: October 20, 2010, 06:17:15 pm
Hi -

I'm using a pololu servo controller via Serial - I have pin #1 (tx) on the arduino connected to "logic-level serial input" pin #3 on the pololu. Power and gnd is wired okay, I'm using 3 servos - it all works.

Sort of.

If I power up the arduino, and connect a terminal (can see the text equivalent of the commands sent to the pololu) everything works great. I can then quit the terminal app, unplug the usb cable, and the servos continue to work fine.

But if I don't hook up the terminal app, it doesn't work. In other words, if I just power up the board with no usb or terminal app, the servos don't move - there is something that the polulo doesn't like (?). As soon as a terminal app is connected, the servos start turning (and the app can be killed and usb unplugged).

I can't figure out what the heck is going on.

Can anyone shed any light? Seems that the act of connecting the terminal somehow "makes it work".

Cheers, and thanks.

b...
19  Forum 2005-2010 (read only) / Interfacing / Re: Support for 4 simultaneous connections in Server on: September 24, 2010, 09:07:45 pm
That's no problem - closing the connection is fine (I don't intend to support persistent HTTP 1.1 style connections). I own the code on both sides - it's a Java executable, making HTTP GET/POST calls to the arduino (using JSON over the wire) to get and send data. Should be simple now, as handling the (up to 4) client connections is easier than I thought.

Cheers - thanks for the help.

b...
20  Forum 2005-2010 (read only) / Interfacing / Re: Support for 4 simultaneous connections in Server on: September 24, 2010, 08:45:36 pm
Okay - I get it. I was thinking more of socket selectors, in that the server->available() call would return one of the active connections (in which case I would need to distinguish, hence my original query).

See how this works - thanks.

21  Forum 2005-2010 (read only) / Interfacing / Re: Support for 4 simultaneous connections in Server on: September 24, 2010, 07:47:59 pm
Hi-

Consider a situation where there are 2 simultaneous connections. In the loop, I call

Client client = server->available();

How can I determine that this is associated with one connection or the other? I need to be able to distinguish. Perhaps I'm missing something. Any help is appreciated.

Thx,

b...
22  Forum 2005-2010 (read only) / Interfacing / Support for 4 simultaneous connections in Server on: September 24, 2010, 06:48:50 pm
Hello!

The web docs indicate that the web server can support up to 4 simultaneous connections - I'm just wondering how I can distinguish these? I want to maintain my own data structure associated with each connection, and so need to associate each connection instance - can I rely on the address of the Client object? Or is there some other way to identify a Client?

Client client = server->available();

This may be one of possibly 4 different connections - how do I know which one?

Is there example code for dealing with more than one connection at a time? The example I have can only deal with one, but the docs indicate 4.

Any help is appreciated.

Many thanks.

b...

23  Forum 2005-2010 (read only) / Interfacing / Re: 2 questions wrt pololu and newsoftserial on: October 11, 2010, 07:32:13 am
Hello -

I am running version 0020, hooked to a pololu servo controller. Everything works fine when I use Serial but I'm trying to move to SoftwareSerial or NewSoftwareSerial. Using SoftwareSerial, I have added:

Code:
SoftwareSerial sss = SoftwareSerial(2, 3);

In the setup function:

Code:
pinMode(2, INPUT);
pinMode(3, OUTPUT);
digitalWrite(3, HIGH);
sss.begin(9600);

And then in the function that outputs the bytes:

Code:
for(int i = 0; i < 6; i++)
{
      Serial.print(buff[i], BYTE);
      sss.print(buff[i], BYTE);
}

If I connect the pololu SIN to pin1 (TX) everything is fine. If I change the SIN wire to pin3 (output for sss) then when the arduino powers up, I get the red light and flashing green (before any calls to move the motor - this is just on power up).

I had the same experience with NewSoftwareSerial.

24  Forum 2005-2010 (read only) / Interfacing / 2 questions wrt pololu and newsoftserial on: October 10, 2010, 06:55:39 pm
Hello:

I have the pololu servo controller working with Serial - no issues. I'd like to use NewSoftSerial and use a different pin for output, but no matter what I try, I get the red LED on and flashing green (baud rate too high). Stumped - is there a compatibility issue? I am setting the baud rate to 9600 - same as for Serial.

When using Serial, after some time of no output changes, the yellow light comes on and the servo moves slightly - can anyone tell me what's going on here?

Any help is appreciated.

Cheers,

b...

25  Forum 2005-2010 (read only) / Interfacing / Re: Help getting started with XBee on: December 21, 2009, 08:51:14 am
Thanks - I'll try that.

But I'm concerned about your experience and not getting Series 2 radios to talk both ways - I need that in my proposed design.

Help from anyone out there greatly appreciated!

Brian...

26  Forum 2005-2010 (read only) / Interfacing / Re: Help getting started with XBee on: December 20, 2009, 05:56:11 pm
Hi

I'm using Series 2 Zigbee modules (both the same). Digi XBee series 2 is what it says on the modules.

They are run with default configurations - my assumption (?) is that I don't have to set them up in any special way.

Here are some values from one of the modules (I checked - they are both the same):

+++OK
ATID
234
ATDH
0
ATCH
0
ATSH
13A200
ATSL
403301F2
ATMY
FFFE
ATDH
0
ATDL
FFFE
ATBD
3

Thanks in advanx.

Brian...

27  Forum 2005-2010 (read only) / Interfacing / Help getting started with XBee on: December 20, 2009, 12:53:23 pm
Hello - I'm wondering if anyone can help - I'm likely doing something daft.

I'm trying to get an XBee module (connected via USB cable to a mac) talking to an XBee on arduino. I'm following the steps on the Getting Started page:

http://arduino.cc/en/Guide/ArduinoXbeeShield

I can download the Physical Pixel sketch to the board, and establish that it is working - can turn on and off the LED via the Serial Monitor when connected by the serial cable (used to download the sketch).

The next step is to remove the cable, and try to send the 'H' and 'L' characters via the XBee module connected via serial - this does not work - I know that I am connected to the correct serial port (ie. the XBee). I'm using ZTerm to send to the serial port, but this does not work.

When connected to ZTerm, I can send the +++ characters and inquire about settings, etc, but I cannot get the H and L characters to be 'seen' by theXBee on the Arduino.

Can anyone help out? I am stumped.

Any help is GREATLY appreciated - I feel so close, but it ain't workin'.

Thanks.

Cheers,

Brian Parkinson
28  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: XBee ZNet 2.5 (formerly Series 2) on: December 23, 2009, 06:14:17 pm
Help - any assistance appreciated.

I have a zigbee module that's fubar'ed - I can't download any firmware (get the 'Write Parameters failed' error).

Am using a XBee Series 2 on a sparkfun XBee/USB breakout board.

Have tried jumpering the pins (9-10 and 16-1) but this doesn't work (I can't reset when the jumpers are set this way).

Any way to ressurect this XBee chip?

Help of any kind is greatly appreciated.

Cheers,

Brian...
Pages: 1 [2]