Show Posts
Pages: 1 [2]
16  Forum 2005-2010 (read only) / Development / Pins for arduino shields. on: December 03, 2008, 05:58:06 pm
Hi, I'm trying to make a veroboard shield and need some of these pin things:

(See the next message, I can't post a link annoyingly.)

I bought some like that from maplin, but they are only just long enough, and I had to file down the solder on the bottom of the board for it to work at all. So, can I ask you fine folk:

1. What are those things called?
2. Could you perhaps provide a link to them on digikey?
3. Can you get the same thing but with sockets on the top so I can stack shields? What are those called and where do I get them on digikey? (The digikey website is definitely not for beginners!)

Many thanks,

Tim

PS: My first veroboard thing was successful - an optoisolated camera controller, but I accidently burnt out one of the optoisolators because the bottom of the veroboard contacted the +5V on the ICSP header! D'oh! It would be awesome if there are pins that raise the board slightly so it doesn't short to the ICSP pins...
17  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 21, 2008, 05:59:12 pm
Aha! It works with version 0011! :-) Is there a bug tracker somewhere?
18  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 21, 2008, 05:00:47 pm
It seems to randomly cut some of the timing short... It doesn't seem to be deterministic. You probably get a similar effect by replacing the

delay(3000)'s with

delay(rand() % 8 ? 3000 : 200); // Assuming rand() works like libc's.

I'm going to try manually making the PWM signal to see if that works. I'll hook it up to a scope too to see if that provides any more insight.

Oh and I've switched to using the Servo library that comes with the arduino IDE. Doesn't seem to have changed anything though.
19  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 21, 2008, 03:24:30 pm
If I replace the loop in your working code with this then it also doesn't work:

Code:
 for (int i = 25; i <= 165; i += 21)
   {
    digitalWrite(ledPin, (i % 2) ? HIGH : LOW);
    servo1.write(i);
    delay(3000);
   }
20  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 21, 2008, 03:19:27 pm
This gets weirder and weirder... I tried your code (but with Servo.h instead - using arduino 0012) and it worked! Why do you do stuff with pin 2 btw?

And this code also works:

Code:
void loop()
{
  for(pos = 40; pos < 140; pos += 20)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    for (int i = 0; i < 1000; ++i)
      delay(1);                       // This works by delay(1000) doesn't. Must b
  }
}

But if I replace the inner loop with delay(1000); it goes all random again. Very odd.
21  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 21, 2008, 09:10:41 am
OK I'm getting really confused! I connected a regulated 5V power supply that says it can supply 2.5A to the 5V socket on the arduino. So now the 2.5A power supply directly powers the servo and the arduino, but it still doesn't work! If I disconnect either the PWM servo controller wire, or its power wires then the code works (i.e. the LED flashes on and off every three seconds).

Any idea what is going on? Basic servos don't use more than 2.5A do they?

Also, if I try using USB to power the arduino and a power adapter to power the servo will that cause issues with the different grounds, or is the control lead of servos isolated from the power leads?
22  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 21, 2008, 07:26:46 am
Yeah but how do you connect the arduino itself to the 5V supply (assuming it is already regulated)? I don't want to have to use two power supplies...

Hmm perhaps the easiest way is to make a USB<->power connector. I think USB provides regulated 5V so that must bypass arduino's regulator...
23  Forum 2005-2010 (read only) / Interfacing / Re: Servos and timing (delay()). on: December 20, 2008, 08:31:36 pm
Actually I tried it without the servo attached and it worked. I think the problem was that I was using the regulated 5V on the arduino to drive the servo. I guess the regulator can't supply that much current and the voltage dropped too low for the arduino.

Is there any way to bypass the regulator? E.g. if I'm running off an already regulated 5V supply (or 5V of batteries)?
24  Forum 2005-2010 (read only) / Interfacing / Servos and timing (delay()). on: December 20, 2008, 11:29:09 am
Hi, I've got a 'hobby' servo that I'm trying to control with the ServoTimeTimer1 library (very similar to the Servo library) but it doesn't seem to work well with the delay() function. Here's the code:

Code:
#include <inttypes.h>
#include <avr/io.h>
#include "WProgram.h"

#include <ServoTimeTimer1.h>

#define servoPin1 9

ServoTimeTimer1 servo1;

 int ledPin = 13;                // LED connected to digital pin 13

void setup()
{
  servo1.attach(servoPin1);
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
    servo1.write(1600);
    delay(3000);
  digitalWrite(ledPin, LOW);    // sets the LED off
    servo1.write(1500);
    delay(3000);
}

What happens is that it often moves to the second position and then goes straight back. I guess it's because the servo library uses the same timer as the delay function. Anyone know of a way around this?

Two other small questions:
1. Should the servo vibrate when it is use? Even when it isn't moving? Seems like bad feedback circuitry if it should...
2. Where can I find a reference to all the registers and stuff needed to write things like the Servo library? Is it GCC stuff or is this info provided by Atmel somewhere?

Thanks.
25  Forum 2005-2010 (read only) / Exhibition / Re: SD card read/write with Arduino on: December 13, 2008, 03:23:34 pm
So back on topic... SD mode IO? SDHC support?
26  Forum 2005-2010 (read only) / Exhibition / Re: SD card read/write with Arduino on: December 10, 2008, 01:38:44 pm
I don't think it will work with microSD. According to wikipedia the SPI mode that this library uses is optional for microSD but required for SD:

http://en.wikipedia.org/wiki/MicroSD

How hard would it be to use the SD mode instead of SPI? And what about SDHC support?
Pages: 1 [2]