Show Posts
Pages: 1 [2]
16  Using Arduino / Project Guidance / Re: OP-AMP for SoundAmp in my proyect. on: February 28, 2012, 11:19:34 am
If you supply your opamps with the +/- 12V, then everything should be fine.

The pot's select the gain you want (See negative feedback application )

When you set the pot to 0 Ohm, then it acts as a buffer (Gain = 1) and when the pot is at maximum, your gain would be 3.2 times your input. Depending on what your input is, you may need to use higher pots, but I think it should be fine.
17  Using Arduino / Project Guidance / Re: Going beyond breadboard on: February 28, 2012, 11:08:11 am
SparkFun Tutorials Embeded electronics 8 9 and 10 is the ones that you'd need for EAGLE PCB

Print them off at seeed studio, 10 bucks for 10 boards (5x5cm) is a great deal!

18  Using Arduino / General Electronics / Opamp selection to drive 50 Ohm impedance on: February 22, 2012, 10:40:37 am
Hi Guys!

I'm trying to amplify a signal from a high impedance source (MCP4725, Sparkfun)
I need to find an buffer opamp that will be able to drive a 50 Ohm input impedance load.

Most opamps I've seen so far only drive a couple miliamps at most. To obtain the fullscale voltage range (0-5V), by Ohm's law V=IR I'd need something that is able to output 100mA. (Unless I am confused?)

If you guys could suggest opamps or workarounds I'd appreciate it!
19  Using Arduino / Programming Questions / Re: Help with newbie code on: February 09, 2012, 12:18:04 pm
Also, the way you got it setup now, INPUTPIN will never go low, nor high, as you defined it as a constant.

I think what you'd want is:
if (digitalRead(INPUTPIN)==LOW)

Also, I just tested your code. The error is coming from your function makesound. You didn't define what the inputs where.

Quote
Void makesound (byte index1, byte index2){

Edit: I changed makesound to void, as you aren't returning anything anyways. Code compiles on my machine with no errors, although I don't think it will do what you expect it to do. Check over your INPUTPIN. Remember that define replaces all instances of INPUTPIN by 2, so in your Setup code, you are making INPUTPIN == HIGH; will return true, but that isn't changing anything?
20  Using Arduino / Programming Questions / Re: Help with newbie code on: February 09, 2012, 12:12:49 pm
byte index1 = 0;

In you loop, you are missing a B (binary)
or else you would be passing a fairly large number, and that can't be saved as a byte!

Quote
index1= B0001100;
index2= B0010011;
21  Using Arduino / Project Guidance / Re: Using Arduino mega for massive high speed data acquisition from a sensor mat on: February 09, 2012, 11:55:56 am
All your loops are generally slow. So are Arduino's builtin DigitalWrite. You may want to consider direct port manipulation.
I achieved 10 times faster read speeds using that.
http://www.arduino.cc/en/Reference/PortManipulation
http://www.arduino.cc/playground/Learning/PortManipulation

DDRA = B11111111; DDR= Data Direction, Port A, 1 = Output
You'd have to do it for the 6-8 ports on the arduino (still much less than the 50 you are doing now)

Setting the pins high
PORTA = B11111111; 1=High, 0=low

Also, I'm guessing that doing port manipulation on the analog read will also increase speed, however I'm not sure how it's done.

Edit: Pin Map. Thought it might be usefull  smiley
http://arduino.cc/en/Hacking/PinMapping2560
22  Using Arduino / Project Guidance / Re: Passing int array to loop() from setup() on: October 11, 2011, 08:54:48 am
Hi Paul,

Thanks for your answer. So when I declare it globally, how can I do it? Since I dont know its size, I get size undefined errors. If I just define it as a simple double, and not a array of double, only the first value is available in main()

23  Using Arduino / Project Guidance / Re: Passing int array to loop() from setup() on: October 11, 2011, 08:29:57 am
Code:
const int ao_x = 5; // Analog Output Pin, for chan x
const int ao_y = 6; // Analog Output Pin, for chan y
const int trig = 10; // Digital Input, for trigger line
int nn = 0; // Counter for number of digital triggers received

void setup() {
  // Open serial communications:
  Serial.begin(9600);
  // Initialise variables:
  double x1, x2, y1, y2;
  unsigned int nx, ny;
  // Get the values TEMP
  Serial.println("Enter the values for x1, y1, x2, y2, nx, ny");
  Serial.println();
 // Temporairly set them until get input working later
  x1 = 0;
  y1 = 0;
  x2 = 1;
  y2 = 10;
  nx = 3;
  ny = 11;
 
  // Cartesian product
  double pos[nx*ny][2], ytemp;
  int nn = 0;
  for(int jj=0; jj<ny; jj++)
  {
    ytemp = y1+jj*(y2-y1)/(ny-1);
    for(int ii=0; ii<nx; ii++)
    {
      pos[nn][0] = x1+ii*(x2-x1)/(nx-1);
      pos[nn][1] = ytemp;
      // Display results of Cartesian Product
      /* Serial.println("loop ");
      Serial.print(nn);
      Serial.print(pos[nn][0]);
      Serial.print(pos[nn][1]);*/
      nn++;
    }
  }
  analogWrite(ao_x, pos[nn][0]);
  analogWrite(ao_y, pos[nn][1]);
  Serial.print("Done! Ready for trigger\n");
}

void loop() {
  // TODO: If trigger in, then increment nn

  // Write x and y chanels
  analogWrite(ao_x, *pos[nn][0]);
  analogWrite(ao_y, *pos[nn][1]);
}
24  Using Arduino / Project Guidance / Passing int array to loop() from setup() on: October 11, 2011, 08:27:37 am
Hi all!

I'm making a simple uC program to perform the Cartesian product and output the results for me.
Currently the way I have it set up is that you input your x and y values in the setup() function, and it builds the Cartesian set (size : x*y by 2 array)

For those of you unfamiliar with the Cartesian Product: Wiki : Cartesian product

Anyhow, once that array is built, I want to pass it to my main function so that it displays the next value of the set everytime it receives a digital trigger on one of the lines.

My question to you is how do you pass an array from a function to the other? I've no experience in C++ and my function keeps giving me errors. I've asked a few friends, and they said that you can't pass arrays around, and it must be done through pointers. I can't make the variable global as I don't know the size of x and y before starting it.

Thanks!

Mike
Pages: 1 [2]