|
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. 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. }
|
|
|
|
|
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.
|
|
|
|
|
58
|
Using Arduino / Programming Questions / Re: Altering 4 digit 7 Segment LED with Pot
|
on: May 15, 2013, 07:42:51 pm
|
int value,num1,num2; You'll probably want an array for the digits instead of separate variables num1 and num2: 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.
|
|
|
|
|
60
|
Using Arduino / Project Guidance / Re: Stop motor above sensor value problem
|
on: May 15, 2013, 11:14:28 am
|
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: outputValue = constrain(sensorValue, 0, 150);
|
|
|
|
|