Show Posts
Pages: 1 ... 57 58 [59] 60 61 ... 68
871  Using Arduino / Motors, Mechanics, and Power / Re: Adafruit Motor Shield code help! on: May 12, 2012, 02:43:59 pm
The RELEASE command will release the voltages, and let the motor come to a stop by itself.
The BRAKE command is not yet implemented by the AdaFruit library, so use the RELEASE for a stop.
Since the L293D uses transistors instead of mosfets, it can't do a nice 'brake' to stop the motor anyway.

10V is no problem. The L293D is limited for the current. It can only do 600mA continuously.
You could measure the current of the motor, and block the motor to see it the current increases.

Once you have it running, even a motor of 200mA will heat up the L293D driver, that's normal.

872  Using Arduino / Networking, Protocols, and Devices / Re: Using the MISO pin when SPI in use on: May 12, 2012, 02:18:19 pm
Explain "SPI is enabled".
Directly on the ATmega chip, or using a library function ?
873  Using Arduino / Networking, Protocols, and Devices / Re: I2C problem (communication stop after like 3 seconds) on: May 12, 2012, 02:16:47 pm
With different drivers I ment for example mixing the Wire library with other libraries for i2c that use their own code.

So you use the Wire library for everything? That's good.

I assume you have the power supply at the ITG decoupled with 100nF, and have also the other capacitors for the ITG sensor. And the AD0 is connected to ground. Did you accidently connect the interrupt output, or is it shortcut to the SDA line ?

The MD25 will turn the motors off for safety, if there is no i2c communication (with the MD25) for two seconds.
So it seems that the ITG3200 blocks the i2c-bus, and the MD25 turns the motors off for safety.

My best guess would be that it is a software problem in the i2c communication with the ITG3200.

I found libraries for the ITG3200 here:
- http://code.google.com/p/itg-3200driver/
- http://awesomecopter.nl/?tag=itg-3200
- http://www.varesano.net/blog/fabio/my-first-6-dof-imu-sensors-fusion-implementation-adxl345-itg3200-arduino-and-processing
Or did you write your own code ?
874  Using Arduino / Networking, Protocols, and Devices / Re: I2C problem (communication stop after like 3 seconds) on: May 12, 2012, 10:48:37 am
Thanks for all the information.
As far as I can tell, there's nothing wrong with it.
I got a lot of comment on this page: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
But it's good to see you try to do the right thing.

Do you use the Wire library?
I hope you don't mix two I2C drivers.
Do you use a library for the ITG3200 ? Perhaps there's an error in the library leaving the I2C-bus in a undesired state.

Perhaps you could add a delay in the software, after you communicate with a I2C device.

Or you could try a test:
Communicate with the ADXL345 and the MD25.
After that communicate with ITG3200 and the MD25.

So you have to do some test, since the problem is not obvious.
It could also be a bad power supply, or a bad connection somewhere.
875  Using Arduino / Sensors / Re: Old Mouse Phototransistor on: May 12, 2012, 08:34:18 am
Can you find a mouse with the same photodiode/phototransistor ? And do some reverse engineering.
876  Using Arduino / Motors, Mechanics, and Power / Re: Adafruit Motor Shield code help! on: May 12, 2012, 02:12:06 am
Sure, that's what the motorshield is for!

You have to create multiple classes during initialization: http://www.forums.adafruit.com/viewtopic.php?f=31&t=16928

There's one more thing to know about the motorshield: You can piggy-back extra L293D on top of the others to increase the maximum current: http://blog.tinyenormous.com/2010/06/23/how-to-piggyback-driver-chips-on-ladyadas-arduino-motor-shield/
877  Development / Other Software Development / Re: Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 11, 2012, 03:08:01 pm
I have changed a lot in the page about level shifting: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter

Everyone should be happy with it now, it is informative and practical and compleet. I think there's no need to make big changes anymore.

I still think that the Wire library should have an option for the internal pull-up resistors though.....
878  Development / Other Software Development / Re: Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 11, 2012, 09:05:57 am
Because one of the advantages of I2C being open-drain is that, you can just use a pull-up resistor to 3.3V instead of 5V, thus you don't need the level shifter

But not according to many datasheet.
It is not just open-drain, it is also an input. And that input is not tolerant for higher voltages on many components.

Or is this about using a 5V i2c component on the same bus as the 3.3V components, with pull-up resistors of 4k7 to the 3.3V ?
879  Using Arduino / Programming Questions / Re: Compare two sensor values on: May 11, 2012, 09:02:46 am
For PaulS:

Code:
  // the absolute difference
  int difference = lightLevel2 - lightLevel1;

  difference = abs(difference);       // 'abs' is the absolute value, the result is always positive.

  if (difference < 10)                      // it's always higher or equal than zero
  {
    // match within 10
  }
  else if (difference < 20)                // the range 0...10 has already been tested
  {
    // they differ between 10 and 20
  }
  else if (difference < 30)
  {
    // they differ between 20 and 30
  }
  else
  {
    // outside range
  }
880  Development / Other Software Development / Re: Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 11, 2012, 07:14:12 am
Did you understand what that page is for?
It is about a bi-directional level shifter for I2C: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
A level shifter is a very often used way. There were questions on the forum, so I decided to collect all of that in a page.

The problem with the internal pull-ups is that it could be outside the specs. So I mentioned that to.
Where are the strong warnings and the numerous solutions ? I can't see them.
881  Using Arduino / Sensors / Re: single axis gyro breakout on: May 11, 2012, 06:58:48 am
The best gyro is just a gyro that meets your speficiations.
Whether it is analog or digital, that is just the interface.
For an analog sensor, you only have to call analogRead() and you got the value.
The digital sensors need a library for the communication with the sensor. The digital versions of a sensor have often a little better specs.

Some sensors have so many options, and can be programmed for the range for example, that only a digital communication can do all of that.
882  Development / Other Software Development / Re: Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 11, 2012, 03:12:53 am
I don't understand the question. Why would you be connecting a 3.3V device to a 5V processor without some kind of level shifter?
Because many people connect a 3.3V I2C device to the 3.3V of the Arduino, and the SDA and SCL directly to the Arduino.
The Wire library activates the internal pull-ups to +5V, so that could be too much for the I2C device.

I have updated my story about level shifters: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
So far, no one knows about a chip that got damaged.
883  Using Arduino / Project Guidance / Re: USB SERIAL SUGGESTION on: May 11, 2012, 02:30:46 am
The Arduino IDE is able to use any serial port.
So any serial port in the operating system can be used.
The operating system has to have it properly installed, with the drivers and so.

If the serial hardware is connected to RXD and TXD on the Arduino, it wil work. But if DTR is not used to reset, you might need to reset it yourself to return to the bootloader. I always use a baudrate of 9600: "Serial.begin(9600);"
884  Using Arduino / Project Guidance / Re: Hardware Serial + PWM interrupt on: May 11, 2012, 02:25:23 am
By the way, the ATmega328p has a special hardware function to determine a pulse width. Search the datasheet for "time-stamp".

See Atmel Application Note AVR135.
To get an interrupt for the falling edge, the edge detection is changed in the interrupt routine. I doubt if this is fast enough for very short pulses.
885  Using Arduino / Programming Questions / Re: Compare two sensor values on: May 11, 2012, 02:09:55 am
I understand.

You want two led bars. One for each sensor.
And you want light a led if the both are about the same.

But the Arduino doesn't have enough pins for two led bars. You could use a 74hc595 and this: http://arduino.cc/en/Tutorial/ShiftOut
If you have used the 74hc595 before, it's easy to do.
If you didn't use the 74hc595 before, you might make things more complicated than they should be.
The same goes for Charlieplexing: http://arduino.cc/playground/Code/Charlieplex   http://www.instructables.com/id/CharliePlexed-LED-string-for-the-Arduino/

If you are just testing, test one sensor with the bar. And after that test the other sensor.
You might even use the bar to show how close the sensorsvalues match (by showing the absolute difference on the bar).

Code:
  // the absolute difference
  int difference = lightLevel2 - lightLevel1;

  difference = abs(difference);         // 'abs' is the absolute value, the result is always positive.

  if (difference >= 0 && difference < 10)
  {
    // match within 10
  }
  else if (difference >= 10 && difference < 20)
  {
    // they differ between 10 and 20
  }
  else if (difference >= 20 && difference < 30)
  {
    // they differ between 20 and 30
  }
  else
  {
    // outside range
  }

Pages: 1 ... 57 58 [59] 60 61 ... 68