Show Posts
Pages: 1 ... 385 386 [387] 388 389 ... 695
5791  Using Arduino / Programming Questions / Re: tx/rx of udp packets/ over ethernet shield and processing on: October 08, 2012, 02:08:59 pm
Please re-edit your post using code tags so we can tell what's code and what's not - the # button generates code tags for you.
5792  Using Arduino / Programming Questions / Re: Pin 1 (Serial TX) usage on: October 08, 2012, 02:05:05 pm
If you use Serial it configures the hardware UART to take over pins 0 and 1 - in this case they cannot be used with digitalWrite().  Use SoftwareSerial instead perhaps?

Alternatively look at the code in HardwareSerial.cpp and figure out what to override.  [ or look the posting mentioned above ]
5793  Using Arduino / Programming Questions / Re: Integers use much less space then Floats?! on: October 08, 2012, 02:00:20 pm
The Arduino software is clever enough to only compile into the binary sketch the code that is actually used - so if you don't use floats you don't get any of the float code incorporated.  Ditto all the other stuff and libraries.
5794  Using Arduino / Sensors / Re: ADXL345 + Uno R2 works while ADXL345 + Leonardo R3 does not on: October 08, 2012, 01:54:49 pm
From what I see from the docs that breakout doesn't have pull-ups.  The fact it happens to work now could mean there are some weak-pull ups somewhere - if so the I2C bus may well be running out-of-spec and it could stop working or go intermittent without warning - perhaps your breakout does have pull-ups installed though? Easy to check with a multimeter.  4k7 is the recommended value.
5795  Using Arduino / Programming Questions / Re: Arduino based incubator - hangs - SOLVED - power supply issues on: October 08, 2012, 01:48:02 pm
Add it from the 5V pin to one of the ground pins.  If its too big a capacitor its conceivable the USB supply could trip out (more likely for an actual computer/laptop than a wall-wart supply).

[BTW there is already 47uF on 5V rail on the standard Arduino]
5796  Using Arduino / General Electronics / Re: easiest way of driving amplifying from 5v to 12v on: October 08, 2012, 08:02:18 am
If the signal to be amplified is AC only, then a transformer is a simple way to level shift, but won't give power-amplification.
5797  Using Arduino / General Electronics / Re: Arduino Mega 2560 ground pin short-circuiting? on: October 08, 2012, 07:58:37 am
oh, WOW! that was stupid! and very simple! thank you so much.

Can u tell me the code that you used?  The example codes that come with arduino ide, which uses pots, doesn't work with my mega, the one named ReadAnalogVoltage, the output at SerialMonitor is always 5v or 1023.

Sounds like 0V end of your pot isn't connected to Ground.  That leaves you with your analog input pin connected through a variable resistor to the +5V pin so it always reads +5V.

The bad way it was connected before would have burnt-out one end of the pot's track I'm afraid...
5798  Using Arduino / Audio / Re: Arduino Modular Synth on: October 08, 2012, 07:55:36 am
Looks fun - considered different input devices (joystick, light sensors or theramin-style capacitive?)
5799  Using Arduino / Sensors / Re: Sensing current on an LED on: October 08, 2012, 07:48:06 am
Just be careful not to accidentally drive 5V into that signal - you could add a 10k resistor in series to prevent that possibility.

[ oh, and one caveat, its possible that the bluetooth module doesn't drive that signal high enough (due to the current load from the LED) - it needs to be 3.0V or more to guarantee working with the Arduino input - you can measure this voltage when the LED is on to double check this ]
5800  Using Arduino / Programming Questions / Re: Assembler error, SoftwareSerial, add even parity bit on: October 08, 2012, 07:44:24 am
I don't know the details, but its a bug triggered when an interrupt routine calls another routine.  If interrupt routine does all the work itself rather than calling a subroutine, I suspect that might cure things - so you'd need to re-write a copy of SoftwareSerial to do things this way.

The underlying problem is probably that the calling convention used in avr-gcc is not the same as that used by the hardware interrupt-handling.

It might be worth investigating which version of avr-gcc you have and what the current version is - try upgrading to that (but be prepared to back-out again!).  I know my (elderly) ubuntu install is using v. 4.3.5, if you post the complete SoftwareSerial mod you have some of us could test if it compiles on their installs.
5801  Using Arduino / Sensors / Re: Keyes Sensor modules - Data sheets???? on: October 08, 2012, 07:37:02 am
Links?
5802  Using Arduino / Sensors / Re: High precision IMU sensors on: October 08, 2012, 07:36:31 am
Noise is not the same as precision.  Precision is not the same as accuracy.  Noise measurements are of the power-per-unit-spectrum, back-converted to amplitude (hence the square-root).  The noise is actually electrical, but is given in terms of g to make comparing different devices performance easy.  The DC-precision might be extremely good even in the midst of lots of noise (you have to low-pass-filter more to remove more noise).  Conversely a low-noise device might be very imprecise.  The faster you want to measure the more important noise becomes.

Having said that no MEMs IMU chip is that accurate or precise, they are far too small to give highly accurate/precise measurements.  Accurate rate-gyros these days are laser-based, accurate accelerometers are basically larger versions of a MEMs device, needing more power.  1 micro-g total noise isn't uncommon from a quick search, < 0.03% linearity, 145dB dynamic range etc etc.

[ quick explanation: in scientific jargon "accuracy" relates to whether the measurement is close to the real value, "precision" relates to how small a step can be recorded consistently by the device (whether or not its accurate).  Thus a tape measure with mm markings has a precision of 1mm, even if it happens to be badly stretched and is 5% out!  Its accuracy is 5%.  In electronics the number of bits from the ADC limits the maximum precision, but a device may be less precise than the number of output bits would suggest (and even less accurate)! ]
5803  Using Arduino / Sensors / Re: ADXL345 + Uno R2 works while ADXL345 + Leonardo R3 does not on: October 08, 2012, 07:08:32 am
That webpage looks wrong.  You _must_ have 4k7 pull-up resistors from SCL to 3V3 and from SDA to 3V3.
5804  Using Arduino / Sensors / Re: LM335A sensor, LED and resistors issue. on: October 08, 2012, 07:06:00 am
The sensor output voltage only changes by 10mV per degree, so its vital that you measure the voltage across the sensor, not the voltage across the sensor plus the voltage along a wire carrying current.  This means the ground wire to the sensor must run _separately_ from any other ground wiring.  You are probably just seeing the IR losses along the ground wiring to the LED.

The Arduino has several ground connections available, reserve one for analog sensors only, use different ones for anything else.

However having said that you are seeing about 0.11V change, which is more than I'd expect - perhaps your 5V rail is not regulated?  The ADC only measures relative to its reference voltage, which is (by default) the 5V rail.  If you power the Arduino from the barrel jack then the internal 5V regulator will be operational and should ensure clean power rail voltage. 
5805  Using Arduino / Sensors / Re: I2C Pressure Sensor on: October 08, 2012, 06:57:14 am
The while loop is dodgy - you need to wait for each byte in turn, if data isn't available you'll skip the loop entirely and not wait.
Code:
  while (Wire.available() < 2)
  {}
  firstbyte = Wire.read();       // Read press high byte
  secbyte = Wire.read();      // Read press low byte

Pages: 1 ... 385 386 [387] 388 389 ... 695