Show Posts
Pages: 1 ... 58 59 [60] 61 62 ... 68
886  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.
887  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:
So far, no one knows about a chip that got damaged.
888  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);"
889  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.
890  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:
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:

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).

  // 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
    // outside range

891  Using Arduino / Motors, Mechanics, and Power / Re: Adafruit Motor Shield code help! on: May 11, 2012, 01:56:53 am
I suggest to use the AdaFruit library, and don't switch the output pins directly.
The AdaFruit library is complicated, and it uses it's own code to create PWM, but you don't have to look inside the library, just use it.

You could do something like this:

int direction = FORWARD;
int speed = 0;


    case 0xC90:
      Serial.println("Vol -");
      speed -= 20;
      motor.setSpeed (speed);

    case 0x490:
      Serial.println("Vol +");
      speed += 20;
      motor.setSpeed (speed);
    case 0x910:
      speed = 0;

    case 0x10:
      speed = 25;

    case 0x810:
      speed = 50;

    case 0x9B0:
      Serial.println("Page Dwn");
      direction = BACKWARD;;
    case 0x1B0:
      Serial.println("Page Up");
      direction = FORWARD;;

I Think that the code will be easier if you keep the switch statement to send the Serial.println messaged, but to control the motor after the switch statement with a lot of 'if' statements. So you can test for numer 0...9, and set the motor speed.
892  Using Arduino / Sensors / Re: single axis gyro breakout on: May 10, 2012, 07:01:58 pm
Sure, you can set the gyro for the right axis.

If you use a gyro that is used a lot, you end up with 3-axis. But that's no problem.

If you read the datasheet of the MPU-6000 or MPU-6050, you can see that the range is programmable up to 2000 degrees/second.
Also the ITG-3200 is up to 2000 degrees/second.

Is this what you are looking for?
893  Using Arduino / Networking, Protocols, and Devices / Re: I2C problem (communication stop after like 3 seconds) on: May 10, 2012, 06:54:30 pm
Can you create links to datasheet ?
How are they connected ?
What is the value of the pull-ups on I2C bus ?
Schematic ?
894  Using Arduino / Project Guidance / Re: Hardware Serial + PWM interrupt on: May 10, 2012, 06:51:13 pm
I am not sure about this, but normally the next interrupt routine waits until the current interrupt has finished.
If you want that one interrupt routine with a higher priority is executed immediately, you have to enable the interrupts in every interrupt routine.
The priority is determined by the order of the vector table. This can't be changed.

I have read this a few month ago, so I could be wrong.
895  Using Arduino / Programming Questions / Re: Compare two sensor values on: May 10, 2012, 06:42:51 pm
I don't know what you want to program.
If the sensors are about the same, should a led turn on? Or should a new led turn (thus incrementing the led bar).

If you map both sensor values, you could just calculate the difference.
int difference = lightLevel2 - lightLevel1;

if (difference < 10 && difference > -10)
  // show new led.

896  Using Arduino / Motors, Mechanics, and Power / Re: Adafruit Motor Shield code help! on: May 10, 2012, 06:31:01 pm
So you want to know how to use the motor shield?

See these pages:

Create a motor class for every motor you have, and use:
motor.setSpeed(128);        // 0...255;      // FORWARD, BACKWARD, RELEASE

There are also cheap clones of the Adafruit motorshield on Ebay.
897  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino Standalone + rs232? on: May 10, 2012, 04:47:29 pm
I see.
It is easier to have a adapter from USB directly to TTL-level serial lines.
The old RS-232 uses higher voltages.

Adafruit has both of them, with some explanation:

If you did build that stand-alone, the 7404 is probably used to be able to handle that higher voltage.
I hope you read the comments for this schematic:
The RXD is an input, so the 7404 port for RXD is drawn the other way around. Also the /RESET is wrong and there are more problems. So the schematic is a total mess.

Perhaps it's better to start all over again.
Do you have a bootloader programmed ?
Can you upload your schematic (and a photo) ?

Did you already use a normal Arduino ? Building one yourself is easier if you already have used one.
898  Development / Other Software Development / Re: Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 10, 2012, 04:33:34 pm
Normally the pull-ups are 4k7 or 10k. So the weak internal resistors are not very good.

I read about a different library that has an option for the init function to select the internal resistors or not. That seems the best way to handle this.
899  Development / Other Software Development / Re: Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 10, 2012, 12:55:04 pm
Are there any 3V I2C chips that are actually confirmed to be unable to handle this very tiny current through their ESD protection diodes?

No, I have never read about this actually causing a problem.
Some datasheets say for example 3.6V maximum, and don't say how much current is the maximum.
If 4k7 pull-up resistors are used to the 3.3V, and the internal resistor is 20k (it is 20k ... 50k), then the result is 3.7 V
900  Using Arduino / Sensors / Re: Interface Arduino with GPS, accelerometer, gyro, magnetometer, barometer on: May 10, 2012, 09:59:22 am
That Daisy-7 board has a lot onboard!
But the BEE Board is Arduino "Compatible", I don't know how much compatible.

Have you found Sparkfun and Adafruit ?

Time to make a choice and go for it. Have fun!
Pages: 1 ... 58 59 [60] 61 62 ... 68