Loading...
  Show Posts
Pages: 1 2 3 [4] 5 6 ... 426
46  Using Arduino / Programming Questions / Re: How to constrain Arduino library on: May 17, 2013, 02:55:15 pm
I would look to see where the other variants are defined and define your variant the same way.
47  Using Arduino / Programming Questions / Re: Simple question about a boolean on: May 17, 2013, 08:36:52 am
If the boolean is three seconds or more true.

Code:
static unsigned long timerStartTime = 0;

if (boolean && (millis() - timerStartTime > 3000))
    counter++;
else
    timerStartTime = millis();  // Re-start the timer if boolean is false
48  Using Arduino / Programming Questions / Re: serial connections on: May 17, 2013, 08:32:34 am
I tried connecting the grounds together to see if that was the problem.

Good, since the ground connection is required.

Does the output from the Arduino show up on Serial Monitor?  That would be a good first step.
49  Using Arduino / Project Guidance / Re: measure 16 digital frequencies on: May 17, 2013, 08:26:50 am
I would try using pulseIn() to measure the length, in microseconds, of the high and low pulses from each fan.  A little math would then calculate RPM.  This requires no interrupts so any Arduino pin would work.

Code:
const int fanPins[16] = {2,3,4,5,6,7,8,9,10,11,12,13,A0,A1,A2,A3};

unsigned long pulseTime[16];

int fanRPM[16];

void setup() {
    for (int i=0; i<16; i++)
        pinMode(fanPins[i], INPUT);  //  Use INPUT_PULLUP if the fan outputs are Open Collector
}

void loop() {
    for (int i=0; i<16; i++) {
        pulseTime[i] = pulseIn(fanPins[i], LOW) + pulseIn(fanPins[i], HIGH);
        fanRPM[i] = (1000000UL / pulseTime[i]) / 60;
    }

    // Process the RPMs here.
}
50  Using Arduino / Programming Questions / Re: Simple question about a boolean on: May 17, 2013, 08:05:12 am
Did you mean:

"at any time during a specific three second interval"

or

"continuously over a specific three second interval"

or

"continuously for any three consecutive seconds"

You have to know exactly what you mean to write code.
51  General Category / General Discussion / Re: A Hardened ARDUINO? on: May 16, 2013, 06:48:55 pm
If you want it waterproof and weatherproof you might try a Pelikan-style waterproof case.  You can find waterproof plastic cases in the camping department of your local department or sporting-goods store.  Be sure  that anything outside the case (sensors, etc) is also waterproof and any holes you make in the case are sealed well.

The main thing to worry about with vibrations is the ATmega popping out of its socket.  Best to use an Arduino with a surface-mount (soldered on) ATmega.  You can make the other components a little more rugged by gooping them with silicone caulk.  Use stranded wire for all your connections since solid wire can't survive repeated flexing as well.
52  Using Arduino / Motors, Mechanics, and Power / Re: Pot and motor forward,release,backward. on: May 16, 2013, 06:39:11 pm
Positions of the pot are read as numbers.  Decide what range of numbers you want to use for each of the three states.  Perhaps you want 0 to 500 to be Forward, 500 to 524 to be Release, and 425 to 1023 to be reverse.
53  Using Arduino / Sensors / Re: Find sketch for rain sensor for seeduino on: May 16, 2013, 06:31:13 pm
That device detects the presence of rain (or other water) but does not measure the rate or amount.
54  General Category / General Discussion / Re: how many servo? on: May 15, 2013, 08:17:22 pm
http://arduino.cc/en/Reference/Servo

"The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega."
55  Using Arduino / Interfacing w/ Software on the Computer / Re: what i must change to add ping to my robot on: May 15, 2013, 08:06:30 pm
There is a library called NewPing that might help.

What do you want to do with the distance information?
56  Using Arduino / Motors, Mechanics, and Power / Re: how can I control 2 cordless drills with 1 potentiometer on: May 15, 2013, 07:54:50 pm
Well, you won't get EXACTLY the same speed but you can connect two transistors or logic-level MOSFETs to a single PWM output pin.

Alternatively, you can connect the transistors to two different PWM pins and use software to set them to the same power level. This would allow you to fine-tune the speeds to get a more exact match.
57  Using Arduino / Project Guidance / Re: Switching power source on/off with Arduino on: May 15, 2013, 07:47:11 pm
Take the wire connecting Arduino Ground to MOSFET Drain and move it from Drain to Source.
58  Using Arduino / Programming Questions / Re: Altering 4 digit 7 Segment LED with Pot on: May 15, 2013, 07:42:51 pm
Code:
int value,num1,num2;

You'll probably want an array for the digits instead of separate variables num1 and num2:

Code:
const int NUM_DIGITS = 4;
int digits[NUM_DIGITS];

You can (and should) use NUM_DIGITS in place of num_displays and ccp_len.

Once you incorporate those changes you might want to show the code again.
59  General Category / General Discussion / Re: Throughhole version on: May 15, 2013, 05:53:14 pm
The UNO bootloader (optiboot) is not board specific. 

For a through-hole design try Single Sided Serial, designed to be made at home and connect to a PC serial port:
http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3

Note: Nobody makes a through-hole USB-to-TTLSerial chip so you either have to use a serial port or a USB-to-TTLSerial cable.
60  Using Arduino / Project Guidance / Re: Stop motor above sensor value problem on: May 15, 2013, 11:14:28 am
Code:
 outputValue = map(sensorValue, 0, 150, 0, 150);

This line does nothing since the input range and output range are the same.

Did you, perhaps, want to constrain the value to the range 0 to 150?  To do that you should use:

Code:
outputValue = constrain(sensorValue, 0, 150);
Pages: 1 2 3 [4] 5 6 ... 426