Show Posts
Pages: 1 ... 399 400 [401] 402 403 ... 583
6001  Using Arduino / Programming Questions / Re: Wifly arduino shield RSSI Vout (signal strength) on: February 29, 2012, 10:40:46 am
I was going to vote for the underdog but they are tied at 1 and 1 so I'm going to boycott this poll instead.
6002  Using Arduino / Motors, Mechanics, and Power / Re: 360 relays on: February 29, 2012, 10:06:17 am
Thanks, John. A matrix layout is great: 3 shift registers to control the columns and 2 shift registers to control the rows. Does that mean I need an OR gate at the row-column junction, i.e. relay input trigger?
Let's assume 24 rows and 16 columns and that your shift registers outputs can source and sink enough current to drive one relay.  Three shift registers source current to the rows directly.  Two shift registers sink current from the columns through diodes.  If you set all rows LOW there will be no current flow.  If you set all columns HIGH there will be no current flow (because of the diodes).  If you set one row HIGH and one column LOW current will flow through the one relay that is connected between that row and column.
6003  Using Arduino / Motors, Mechanics, and Power / Re: 360 relays on: February 28, 2012, 11:10:28 pm
So back to my other question. Do I really need 45 8-bit shift registers in order to control 360 relays? Any way to reduce the number?

Since you only want to turn on one at a time you could put them in a 24x16 matrix.  That would get you down to 5 shift registers.
6004  Using Arduino / Installation & Troubleshooting / Re: The order of variable assignment causing error. on: February 28, 2012, 10:56:22 pm
I suspect the problem is:
Code:
Serial.println("command Received: " + command);

I don't think that string constants implement the concatenate operation.  I think it's trying to do math on the address of the string.

Try this to see if it fixes the problem:
Code:
Serial.print("command Received: ");
 Serial.println(command);
6005  Using Arduino / Programming Questions / Re: Editing and Compiling Libraries on: February 28, 2012, 10:46:54 pm
Is your ShiftPWM folder in the libraries folder in your Arduino sketch folder?  Does the example show up as Files->Examples->ShiftPWM->ShiftPWM_Example1?

It sounds like you have two copies of the library: the one in 'libraries' that gets compiled and linked with your sketch and one in the sketch folder that you are editing without effect.
6006  Using Arduino / Programming Questions / Re: Fast Fourier Transformation Library? v2.0 on: February 28, 2012, 10:39:27 pm
The 128-sample FFT gives 64 results (n/2).   The original code averages them as 14 sets of 4 (56 of the 64 samples).  If you use 12 sets of 4 you are only using 48 of the 64 samples.  You might want to  make it 12 sets of 5 to use 60 of the 64 samples.
Code:
// average bars together
 for (i=0; i<12; i++) {
 data_avgs[i] = data[i*5] + data[i*5 + 1] + data[i*5 + 2] + data[i*5 + 3] + data[i*5 + 4]; // average together, for 12 sets of 5
 data_avgs[i] = map(data_avgs[i], 0, 37, 0, 12); // remap values for my application, so 12
 }
You may need to tune the map().  Since you are adding 5 samples together instead of 4 I made the limit 25% higher.  I suspect they just tried several values until they got one that looked nice (30).
6007  Using Arduino / Programming Questions / Re: Wifly arduino shield RSSI Vout (signal strength) on: February 28, 2012, 10:24:38 pm
Do you have a serial port connected to the WiFly UART port?

You switch to command mode by sending "$$$".  I think you have to send nothing else within one seconds before and one second after.
Code:
delay(1000);
WiFly.write("$$$");
delay(1000);
If the first thing you get back is not "CMD" then something is wrong.
6008  Using Arduino / Project Guidance / Re: Simple IR Distance Sensor Code on: February 28, 2012, 10:06:08 pm
Does the distance change?  if not you would probably be better served with a mechanical switch.  They tend to be more repeatable than a non-contact sensor.
6009  Using Arduino / Project Guidance / Re: Simple IR Distance Sensor Code on: February 28, 2012, 08:49:13 pm
Hey guys,

For a design project I will have a plate being pushed toward another fixed plate with a spring in between the two (using a motor), once the plate separation reaches a certain distance the motor will stop, releasing the plate and launching a ball sitting on the other side of the plate into the air. 

So, I need a sensor to sense the plate separation distance with fairly good accuracy and reliability.

The sensor will be mounted in a noise free environment and only moving close to one another one-dimensionally, so i was thinking just have an IR emitter on one plate, and a IR detector on the other plate because this would be the cheapest and easiest solution (provided the code isn't too crazy).

Would it be possible to detect distance by the amount of time it takes the signal to reach the IR detector from the emitter? how accurate would it be? and is there any code for this available?

Thank you very much for your help,
Sean

It's not practical to use time-of-flight LIDAR for short distances unless you can measure arrival times in picoseconds.  The Arduino isn't very good for that.

If your release distance is fixed you would typically use a mechanical limit switch   If you want a variable distance there are ways of detecting motor revolutions so you can measure how far the plate has been pushed.  If you really need a non-contact sensor, Sharp makes an IR distance sensor.  It uses triangulation to determine distance.  Another choice would be an ultrasonic distance sensor.
6010  Using Arduino / Sensors / Re: non-arduino speed sensor on: February 28, 2012, 07:39:54 pm
I think i may have found the problem. Would I a pull down resistor? My test speed was 5-10mph. The sensor was on and working.  Below is the code i have tried with the sensor. Nothing fancy just trying to see if i'm getting an input.

I didn't see anything in the manual that says what the pulses look like.  If it's a 12V signal (since the device runs on 12V) you will have a problem.  If the output is "open collector" you will need a pull-up resistor.  You can use the internal pull-up by adding "digitalWriat(2, HIGH);" after "pinMode(2, INPUT);".
6011  Community / Gigs and Collaborations / Re: Motorized camera slider on: February 28, 2012, 02:01:54 pm
It's much easier to work on Arduino projects when you have access to the target hardware.  Because of that you might want to seek someone local to you.  To do that you should probably give an indication of where in the world you are.
6012  Using Arduino / Storage / Re: Storing a 5 digit number in the EEPROM on: February 27, 2012, 10:36:23 am
thanks for the help!! one last thing i would like ask... How many 5 digits number can i store in the atmega328PU's EEPROM using the code given above

http://arduino.cc/en/Reference/EEPROM
"The microcontrollers on the various Arduino boards have different amounts of EEPROM: 1024 bytes on the ATmega328, "

That can hold  512 words (16-bit) values.
6013  Using Arduino / Storage / Re: Storing a 5 digit number in the EEPROM on: February 27, 2012, 09:33:17 am
also could explain to me how this code is working?

http://arduino.cc/en/Reference/WordCast

http://arduino.cc/en/Reference/LowByte
http://arduino.cc/en/Reference/HighByte

6014  Using Arduino / Installation & Troubleshooting / Re: Arduino Uno doesn't start sketch when it it disconnected from USB on: February 27, 2012, 09:22:15 am
Does it work after you press the reset button?

Perhaps if you show your sketch we can figure out why it might be getting stuck.

What model of Arduino are you running on?
6015  Using Arduino / Storage / Re: Storing a 5 digit number in the EEPROM on: February 27, 2012, 09:19:56 am
An unsigned integer can hold values up to 65535.

Code:
void writeWord(unsigned address, unsigned value)
   {
   EEPROM.write(address, highByte(value));
   EEPROM.write(address+1, lowByte(value));
   }

unsigned readWord(unsigned address)
    {
    return word(EEPROM.read(address), EEPROM.rear(address+1));
    }
Pages: 1 ... 399 400 [401] 402 403 ... 583