Show Posts
Pages: [1] 2 3
1  Using Arduino / Installation & Troubleshooting / Any way to salvage a blown board? on: February 22, 2013, 08:45:58 pm
Hi there, I'm not sure what I did, but something happened to my UNO board and now the computer does not recognize the board anymore when I plug it into the USB. I've read in other articles here that for all practical purposes my board is dead.

As an additional note, when I press and release the RESET button on the board, the LED on pin 13 flashes 3 times - and still nothing happens. At no point in time does the board get recognized via USB.

So my next question is: is there any way to salvage the board, or parts thereof? I heard some people try to order a new chip, etc. but have mixed results. I have no problem getting a new board, but it feels such a shame to throw away the high quality board if it can be salvaged somehow

Any help and advice will be appreciated!

Thanks,
- K.
2  Using Arduino / Programming Questions / Re: Dynamic instantiation of objects? on: February 12, 2013, 02:32:10 pm
Hey folks, thanks for the replies. Apologies for the syntax errors - I switched over to C# for a few years and haven't written C/C++ in a while.

I was actually not aware that the compiler supports pointers as I didn't notice it being mentioned in the Arduino reference. What I was (more or less) trying to support was this:

void AssignServosToPins(int numServos, int *pinAssignments)
{
  int i;
  Servo **servoArray = (Servo **)malloc(numServos * sizeof(Servo *));
  for (i = 0 ; i < numServos; i++)
  {
    servoArray = new Servo();
    servoArray->attach(pinAssignments);
    servoArray->write(0);
  }
}

I'm not too worried about the free() bug as this will be a one-time initialization only. As I mentioned, I don't know the capabilities of the compiler too well, so I was not sure if malloc(), sizeof() and the "pointer-to-pointer" double inference syntax are properly supported in the compiler.

Appreciate everyone's help. I guess I'll just have to do some trial-and-error.
3  Topics / Robotics / Re: Arduino Uno - which pin can control servos? on: February 12, 2013, 01:26:27 pm
Folks, just hooked up my servo on pin 16 (Analog pin 3 on my UNO), hooked up the servo library with a few lines of code and it just worked! Thanks for the advice.
4  Using Arduino / Programming Questions / Dynamic instantiation of objects? on: February 12, 2013, 01:24:02 pm
Hey folks, got a really newbie question here. I am working with the Servo library, and was wondering if there is a way for me to dynamically instantiate Servo objects.

In most examples, I see static instantiation of Servo objets, like this:

Servo myServo;

Which is cool when you know how many servos you're going to have. But is there a way for me to instantiate a number of Servo objects based on a variable, such as (I'm using C++ syntax here):

Servo arrayOfServos[MAX_SERVOS];
if (numServos < MAX_SERVOS)
{
  for (int i = 0; i < numServos; i++)
  {
    Servo newServo = new Servo();
    newServo.attach(somePin);
    newServo.write(0);
    arrayOfServos = newServo;
  }
}

Any help will be appreciated here!

Thanks,
- K.
5  Topics / Robotics / Re: Arduino Uno - which pin can control servos? on: February 12, 2013, 11:58:31 am
Thanks both, this is very helpful. I am using a GWS S125 6TD "Sail winch" servo. I read some documentation that claims it has a resolution of 4,096 positions (12-bit ADC?) across a motion range of 6 full turns, but I can't find that link anymore. Honestly I don't need that kind of precision. In fact, 0-180 (approx 12 degrees per step) is probably more than enough for my application, but I'm always interested in the boundary conditions of maximum control just in case the need comes up.
6  Topics / Robotics / Re: Arduino Uno - which pin can control servos? on: February 12, 2013, 01:35:36 am
Oh by the way, is there a library that provides better resolution than 0-180 degrees? I'm trying a control a servo that has 6 turns lock-to-lock (i.e. 2160 degrees of travel from one end to the other) so a higher resolution than 180 positions would be quite useful.

Thanks again!
- K.
7  Topics / Robotics / Arduino Uno - which pin can control servos? on: February 12, 2013, 01:25:08 am
Hi there, been away for a while but started pikcing up a project that I left off for over a year. I haven't worked on this for a while so please forgive me if I am a bit rusty. I'm at a point where I would like to have my Arduino UNO control a servo. I've been reading a lot of posts out there, but there seems to be a couple of libraries out there to choose from (Arduino Servo library included in the IDE, and a Software Servo library, etc.).

Most people seem to recommend to use pin 9 and 10 to control the servo. However, I already had these two pins controlling two motor drivers so they are not an option. I've seeon other examples that seem to suggest that any output pin (PWM or not) can be used to control a servo, but I'm not sure if that's specific to just a particular servo library or not. I've also seen comments on Arduino 1.0.17 or newer having different capabilitites than the older boards when it comes to servo control. I'm also interested in finding out whether using a pin to control a servo will change the PWM characteristics of other pins.

I guess I am hoping to find out the pros and cons of the different servo librarys, and which other pins I can use to control the servo. Currently, digital pins 0-2 and 9-13 are all assigned to specific functions, but the rest of the digital pins and all the analog pins are still open to assignment.

Any help will be greatly appreciated!

Thanks,
- K.
8  Using Arduino / Programming Questions / Re: Email attachments from arduino as an SMTP client on: August 16, 2011, 11:13:32 am
Code:
delay(wait); /* wait for a response */
If you are waiting for a response, shouldn't you then read the response? Or else remove the incorrect comment. Even better, remove the useless delay() calls.

Some [older] SMTP servers don't support pipelining (i.e. receiving a new command before the current command is responded to), and even for servers that support pipelining, some commands are in herently not pipelineable, so sending commands in quick succession without a bit of delay might be problematic (especially if the sketch is not handling server errors. It might be safer to keep some sort of delay.

Not reading the server response should not be a big deal and the receive buffer should just fill up with unread responses. Downside is of course it can't process server errors. I'm not sure how the Serial stack on the Arduino handles full buffers but if it follows general parctice it will just silently drop the new bytes.

I think the safer way (if reliability is an issue), is to replace the constant wait with a function call that loops to wait for client.available() > 0, and just read and discard the bytes beefore sending the next command. This ensures the server had responded, and to account for transient network delays that causes replies to come back more than the constant wait period.

I realized that I might be getting off topic here ...
9  Using Arduino / Networking, Protocols, and Devices / Re: Password protect for arduino webserver? on: August 15, 2011, 01:15:53 pm
I think the easiest way might be to have your client send in a cookie that contains the username/password info and to have your web server refuse to respond unless the cookie clears verification ("session-based" auth). Principal-based authentication is not defined in the HTTP protocol (as far as I know), and usually such authentication is done through web pages. So short of using HTTP headers and cookies you will most likely have to extend the protocol to support these semantics yourself.

Just my 2 cents' worth of course.
10  Using Arduino / Programming Questions / Re: goto statement in ISR? on: August 15, 2011, 12:58:21 pm
I think the problem lies in the architecture of the long function, and the fact that a long-running, linear function is at odds with the asynchronously-resettable requirement of the external stimuus (i.e an interrupt in this case).

I would break down the long function into smaller, faster states and build a resettable state machine that can always start from the initial state. Something like this:

Code:
int state = 0;

void ISR()
{
  state = 0;
}

void loop()
{
  switch (state)
  {
    case 0:
      calcuateThis();
      state = 1;
      break;
    case 1:
      calcuateThat();
      state = 2;
    case 2:
      computeResults();
      state = 0;
      break;
  }
}

You get the idea. Of course, it makes the system harder to build and debug, and the system must survive the state reset in any previous state, but it sure beats trying to unwind the program stack and stuff.

Just my 2 cents' worth from a backseat programmer.   :-)
11  Using Arduino / Programming Questions / Re: Does Arduino keep the state of pin? on: August 15, 2011, 12:44:18 pm
I was seeing something very similar when I was testing the digital output functionality. A short while back I was trying to figure out why my relay driver circuit was always ON whether I set the digital pin to "0" or "1".

After a lot of scouring around, I learned the hard way that I had to explicitly set the digital pin as OUTPUT (duh). In a nutshell, the Arduino digital pins are all initiaized to INPUT by default, which is a High Impedance state (~10MOhms). Long story short, due to the much lower input impedance of my driver circuit, it seems to draw just enough extra current that it will be activated even if the digital output is set to "0".

Oddly, my observation with a DVM is similar in that the "0" state output is also around 1.5-2V, which was higher than one would expect. I tried adding pull-up and pull-down resistors but I still got glitchy results. But after reading the description of the I/O pins:

http://arduino.cc/en/Tutorial/DigitalPins

I just had to explicitly set the pin to OUTPUT, an everything worked like a charm afterwards. Since I didn't see your setup() function, I'm not sure if you are already setting the pit to OUTPUT - but it's worth a shot because the solution is not obvious.
12  Using Arduino / Programming Questions / Re: Email attachments from arduino as an SMTP client on: August 15, 2011, 12:19:43 pm
Hmmm, the only thing I can think of is that \r might not be an allowed character in the SMTP protocol, so instead of \r\n (which is CR-LF, where CR is only relevant for screen display), you can use \n only. Try breaking down the combined lines in the one print() call into separate println() commands and you might be able get more meaningful diagnostics.

Just my 2 cents' worth.
13  Using Arduino / LEDs and Multiplexing / Re: So called LED lighting drivers on: August 15, 2011, 10:45:09 am
Thanks everyone for your explanations! In that case, does anyone know of ICs that have multiple FET driver circuits (with low enough Rds) in a single package?

Thanks again!
14  Using Arduino / LEDs and Multiplexing / So called LED lighting drivers on: August 15, 2011, 12:41:16 am
Hi folks, another newbie question. Not sure if this is the right forum as it seems more specialized with display LEDs, but I figured this might be the best forum to post this.

So I'm looking into controling several LED lighting circuits (abour 3-5W per circuit @12VDC). I've been looking at a lot of existing products out there, and most of them require LED "drivers" to drive them. So my question is: are the so-called LED drivers just bonefied AC-DC power supplies, or is there something special about these drivers?

And if I wanted to build a circuit to control (i.e. switch on and off) these LEDs circuits via the Arduino without using relays, any suggestion as to what type of circuit I should use? Assuming my power supply has enough juice, would a simple Dralington transistor suffice?

Finally, if I wanted to get fancy and try to dim these LEDs, would PWM work for dimming LEDs?

An advice will be appreciated!

Thanks,
- K.
15  Using Arduino / Programming Questions / Re: Email attachments from arduino as an SMTP client on: August 12, 2011, 01:48:43 pm
If I remember correctly, I believe any Headers (starting from CONTENT-TYPE) is actually part of the mesage content, and needs to come after the DATA command - but I must admit I'm a bit rusty on this.

Seems like you are only printing the responses from the server. It would help diagnostics if we can also see the outbound SMTP commands to the server too.
Pages: [1] 2 3