Show Posts
Pages: 1 ... 58 59 [60] 61 62 ... 68
886  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:
Code:

int direction = FORWARD;
int speed = 0;

........

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

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

    case 0x10:
      Serial.println("1");
      speed = 25;
      motor.setSpeed(speed);
      break;

    case 0x810:
      Serial.println("2");
      speed = 50;
      motor.setSpeed(speed);
      break;

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

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.
887  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?
888  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 ?
889  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.
890  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.
Code:
int difference = lightLevel2 - lightLevel1;

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

891  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:
http://www.ladyada.net/make/mshield/
http://www.ladyada.net/make/mshield/use.html

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


There are also cheap clones of the Adafruit motorshield on Ebay.
892  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:
(1) http://www.adafruit.com/products/18
(2) http://www.adafruit.com/products/70

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: http://arduino.cc/en/Main/StandaloneAssembly
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.
893  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.
894  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
895  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 ?
http://www.sparkfun.com/categories/23
http://www.adafruit.com/category/35

Time to make a choice and go for it. Have fun!
896  Using Arduino / Sensors / Re: How to determine sensor is compatible with Arduino UNO? on: May 10, 2012, 08:24:42 am
I want to collect everything about I2C level shifters here: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
Feel free to add to that page.
897  Development / Other Software Development / Wire library enables internal pull-ups -> bad for 3.3V I2C devices. on: May 10, 2012, 08:15:59 am
The function twi_init() in twi.c enables the two internal pull-up resistors.

If a 3.3V I2C device is connected to the 3.3V, and the Wire library is used, the SDA and SCL lines have the internal pull-resistors to 5V.
Some low power I2C devices might have problems with that.
Allthough it should have open-drain or open-collector, according to some datasheets, the SDA and SCL may not exceed the 3.3 or 3.6V.

I have mentioned this also here: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter  (search for the word "violate").


This forum question is about the internal pull-ups: http://arduino.cc/forum/index.php/topic,105196.0.html
898  Using Arduino / General Electronics / Re: I2C Pin Voltage on: May 10, 2012, 08:08:14 am
We should be able to use the Wire library for 3.3V components.
So I have posted this: http://arduino.cc/forum/index.php/topic,105291.0.html
I think that the wire library should change (replies about wire library with that topic please).
899  Using Arduino / Installation & Troubleshooting / Re: Uno Rev.3 3.3V Source on: May 10, 2012, 08:04:44 am
I wrote a page about level shifters in the Playground section: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter
And I checked the Wire library, it does indeed set the internal pull-ups to 5V. I've started a new topic about that: http://arduino.cc/forum/index.php/topic,105291.0.html
900  Using Arduino / Sensors / Re: arduino thermal anemometer on: May 09, 2012, 01:52:08 pm
Added to playground: http://arduino.cc/playground/Main/ThermalAnemometer

It's needs some beautifying.
I have also added a link at the environment section.
Pages: 1 ... 58 59 [60] 61 62 ... 68