Show Posts
Pages: 1 ... 114 115 [116] 117 118 ... 278
1726  Using Arduino / Programming Questions / Re: Need help troubleshooting error on: June 13, 2013, 04:55:10 pm
LEDs look fine.
1727  Using Arduino / Programming Questions / Re: Need help troubleshooting error on: June 13, 2013, 04:52:57 pm
Yep, it is as I thought.  The input is permanantly high, until you press the button, when the whole arduino dies due to a short circuit.

I suggest you read up on how to wire up a button
1728  Using Arduino / Programming Questions / Re: Need help troubleshooting error on: June 13, 2013, 04:19:15 pm
It looks to me like you have your button signal connected direct to +5V, and the other side of the switch connected to GND.  Press the button, and you short circuit your power supply (USB) and the computer shuts off the power to prevent damage.

Be glad you're using USB and not an external power supply - your voltage regulator may have gone into meltdown if you were.
1729  Using Arduino / Programming Questions / Re: Need help troubleshooting error on: June 13, 2013, 04:14:42 pm
Can we have more detail of the button area please?

Maybe draw out a schematic on paper and photograph that too smiley-wink
1730  Using Arduino / Installation & Troubleshooting / Re: Can't download with 1.X, can with 023 on: June 13, 2013, 04:12:02 pm
Do you have !!! in your sketch anywhere?
1731  Using Arduino / Installation & Troubleshooting / Re: Is this a bootloader error? on: June 13, 2013, 04:10:38 pm
If the light doesn't flash is there a problem with the ATmega16U2 chip? My computer won't find my Uno R3 any more. The green power LED lights (on USB or 9v supply) but the orange transmit light won't. I can't talk to the chip if the PC won't connect, right? I'm a ME and this computer science stuff is new to me.
Instead of tagging the same thing on everyone else's thread, why not start your own - you might get a response then.
1732  Using Arduino / General Electronics / Re: can soldermask + paste keep a package from shorting to vias? on: June 13, 2013, 03:44:10 pm
The exposed pad is there for a reason.  If you fail to use it you risk the component going out of specification and breaking.

Either select a different component that doesn't require the exposed pad, or re-design your board to use the exposed pad.
1733  Using Arduino / Programming Questions / Re: Need help troubleshooting error on: June 13, 2013, 03:41:36 pm
Am I blind, or do I not see anywhere at all where you ever turn OFF any of the LEDs?

Also, how is your button wired up?
1734  Using Arduino / Programming Questions / Re: Size of array on: June 13, 2013, 09:04:59 am
There isn't one.

There is no such thing as an unoccupied position in an array - every entry has a value.

You could go through and count the number of entries that match a certain criteria.
1735  Using Arduino / Programming Questions / Re: Size of array on: June 13, 2013, 07:32:23 am
sizeof returns the size of the allocated memory for the array.  This will never change.

To find out how long a string is (string as in null-terminated character array) use the strlen() function.
1736  Using Arduino / General Electronics / Re: Mosfet switches without a cause on: June 13, 2013, 04:12:38 am
OK, I thought a bit about the whole "long cable => low pulldown" theme - and I don't get it.

As long as my button is not pressed, the pulldown resistor pulls my input-pin to ground. At that moment the value of the resistor is completely irrelevant.

As soon as my button is pressed, I have a series of resistors between 5V and GND:

R(C) is the cable resistance and R(P) is the pulldown-resistor.

That is a voltage-divider, the voltage "x" that is applied to my input is as follows:

x = 5V/(RC+RP) * RP

As long as RC is as small as possible, we have

x = 5V / RP * RP = 5V

As soon as I have a hiogher value for my cable-resistance, let's say RC = 1k (which is far beyond realistic!), my RP gets interesting:

x = 5V / (1k+RP) * RP

let's fill in some values:

100o   =>   x = 5V / (1k+0,1k) * 0,1k = 0,45 V
1k   =>   x = 5V / (1k+1k) * 1k = 5V / 2k * 1k = 2,5V
10k   =>   x = 5V / (1k+10k) * 10k = 5V / 11k * 10k = 4,54V
100k   =>   x = 5V / (1k+100k) * 100k = 5V / 101k * 100k = 4,95V

So in my opinion, the higher the resistor is, the better my input-value should be.

Realistic, cat5-cables have a DC-resistance of 50-150Ohm/km, so anything above 1k should be perfect.

So why do you say that I should try a lower pulldown-resistor because of the long cables? I don't want to argue, but I'd love to understand! smiley

It's all to do with current flow and noise rejection.  A lower resistance causes more current to flow.  That's what the "strength" of a pull up or pull down resistor is all about.  A "weak" one, like inside the Atmel chip, is typically 20K.  "Average" is 10K.  "Strong" is 1K-4K7.

When you press the button, the button, cable and resistor form a voltage divider.  That mid point of that divider is then connected to the gate of a MOSFET, which is a capacitative element.  Current needs to flow into that gate to turn it on, or out of it to turn it off.  The more current you have available in the voltage divider to turn it on, and the lower the resistance on the pull-down to turn it off, the better it is.  But at the same time you don't want to waste current smiley-wink
1737  Using Arduino / Programming Questions / Re: Flickering 4 x 7 segment display on: June 13, 2013, 03:40:42 am
You're modifying V every loop iteration, but you're only getting its starting value once every 500 ms.

You should have another variable that you store the temperature in.  Get the temperature into that variable every 500ms, and then copy it into V every loop.
1738  Using Arduino / Programming Questions / Re: Understanding the 4051Multiplexer code on: June 12, 2013, 12:14:31 pm
... except you want to shift *before* the or, not after, or the last bit will always be 0 and you'll lose your first bit off the end.
1739  Using Arduino / Programming Questions / Re: Understanding the 4051Multiplexer code on: June 12, 2013, 08:36:04 am
You can read multipex[count] quite happily should you want to.  Putting the LEDs in an array will make the whole thing more efficient.  However, you could short-cut it:

Code:
for (count = 0; count < 8; count++) {
  selectMultiplex(count); // do whatever you need here
  digitalWrite(led[count], digitalRead(A0));
}
1740  Using Arduino / Programming Questions / Re: Understanding the 4051Multiplexer code on: June 12, 2013, 06:36:14 am
You always read from the analog pin that the multiplexer is connected to.  So, if it's wired to A0, then you always read from A0.

Code:
1. Switch MUX to input 0
2. Read from A0
3. Compare with threshold value (NOT "HIGH")
4. Do something
5. Switch MUX to input 4
6. Read from A0
7. Compare with threshold value
8. Do something
... etc ...
Pages: 1 ... 114 115 [116] 117 118 ... 278