Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: Supplying power to a standalone ATMega328P-PU on: February 11, 2013, 09:17:30 am
Ok, I understand.

Forgive me for all the questions, just using hypothetical situations to help my understanding.

If I were, as Cookies said he does when prototyping, to THEORETICALLY leave out AVCC, could I THEORETICALLY leave out a ground?
2  Using Arduino / Microcontrollers / Re: Supplying power to a standalone ATMega328P-PU on: February 11, 2013, 06:57:29 am
Ok thanks Cookies, that was obviously what you meant after reading your post again!

Tack, are you saying that I would only need one GND if, in theory, I WASN'T to use the AVCC?

Thanks,

Sam
3  Using Arduino / Microcontrollers / Re: Supplying power to a standalone ATMega328P-PU on: February 11, 2013, 05:26:30 am
Thanks Cookies, so I need pin20 connected to 5V if I'm using the analog pins?

Thanks
4  Using Arduino / Microcontrollers / Re: Supplying power to a standalone ATMega328P-PU on: February 11, 2013, 04:29:18 am
Yes tack, I mean do I have to use both 5V and both GND pins, or can I use one of each?

I thought the fact that the circuit needed to be complete was obvious.
5  Using Arduino / Microcontrollers / Supplying power to a standalone ATMega328P-PU on: February 10, 2013, 06:27:04 pm
Just a quick one - do both +5V and GND pins need to be connected to +5V and ground, e.g. from a voltage regulator? Or can I leave one of them empty?

Would make designing my stripboard a lot easier!

Thanks,

Sam
6  Using Arduino / Audio / Re: MSGEQ7 reading constant values on: December 20, 2012, 03:07:23 pm
I did, buy purchasing another chip. Mine originally came from China on ebay but i got this one from protopic
7  Using Arduino / Audio / Re: MSGEQ7 reading constant values on: October 10, 2012, 05:26:45 pm
I ordered another chip yesterday, should be here tomorrow.

I own a cheap multimeter and went over it with my grandad (I'm 17,just getting into electronics, he's been at it for years!) and we couldn't see anything out of the ordinary. Unfortunately, neither of us own a 'scope. I have been over the wiring countless times.

If the second chip works, great. If it doesn't, and it works the same, it will spur me on to fix it and get it working as then I will have two to play with!

Many thanks for your help so far

Sam
8  Using Arduino / Audio / Re: MSGEQ7 reading constant values on: October 10, 2012, 02:38:55 pm
There is nothing wrong with my Arduino, just connected 5V to A0. The grounds are connected.

For the audio I am using a headphone jack from either my laptop or my iPod, neither work.

Sorry for the slow reply

Sam
9  Using Arduino / Audio / MSGEQ7 reading constant values on: October 09, 2012, 02:33:41 pm
Hi all,

My problem is that my MSGEQ7, hooked up exactly as it is here: http://nuewire.com/info-archive/msgeq7-by-j-skoba/, with the same code, only produces ~47 across all the values. I've tried all sorts. I have the right capacitors, everything. The only difference is that instead of a 200k resistor, I am using 2x 100k in series.

Any idea what might be happening?

Sam
10  Using Arduino / LEDs and Multiplexing / Best way to control 64x64 rgb leds? on: September 25, 2012, 06:02:42 pm
How would i go about performing this with an arduino? I have an uno, would I have to use shift registers? Multiple arduinos? I really don't know where to begin.

Many thanks for any help at all,

Sam
11  Using Arduino / LEDs and Multiplexing / Re: Daisy chaining 74HC595 shift registers on: September 08, 2012, 03:28:37 am
Ok thanks to all, I will attempt that when I get home this afternoon.

And Chagrin, the reason I use constrain() is because the voltage is coming straight from an iPod headphone jack, and so is very small, so until I obtain a small transformer I am limiting the readings as otherwise anything over about half a volt is never reached, this gives me a view of the whole range of LEDs working.

Unless there is another method I could use for either stepping up to voltage or varying the readings? At the moment I only get all the LEDs when the iPod is at full volume, which when plugged in to a dock as well is none too pleasant for my ears!

Another quick question about the bit functions: is 8>>bit the same as bit <<8? Ie does it matter what is in the left and the right or is it purely based on what the "arrows" (don't know the proper name) are pointing from and to?

Thanks,

Sam
12  Using Arduino / LEDs and Multiplexing / Daisy chaining 74HC595 shift registers on: September 07, 2012, 08:11:52 pm
Right, first things first, if this is in the wrong section, feel free to move it.

Now, onto the question:

I am trying to make sound-reactive LEDs (you may have seen my last post). I have a bar of 8 working fine with one 74HC595. Now I want to try and use 16 LEDs.

I have wired the Q7' pin from the first to the DS pin on the second, and I figured that if I were to write a value bigger than 255 to the first register, then the bits would over flow into the second, e.g. if I were to write 511, all 8 pins would light up on the first register and one on the second. However, they work independently from each other, both doing the same thing, like two bars of 8.

My sketch can be found here: http://pastebin.com/7a7JExdc

Thanks for any help provided,

Sam
13  Using Arduino / LEDs and Multiplexing / Re: Problem with binary and shift register on: September 06, 2012, 07:09:12 am
Bit functions worked very well, thanks for the help.

Sam
14  Using Arduino / LEDs and Multiplexing / Re: Problem with binary and shift register on: September 05, 2012, 02:40:11 am
Thankyou very much for the replies, I will look into bit functions and operators as suggested.

Also, thankyou tmd3 for using examples that I can actually follow in my code, I've seen all too many people of my experience become completely confused by replies as they don't see how it fits into their problem.

Sam
15  Using Arduino / LEDs and Multiplexing / [SOLVED]Problem with binary and shift register on: September 04, 2012, 05:05:56 pm
Hi all, figured this was PROBABLY the right place for this, but it could probably also fall under Programming Questions.

Basically I am trying to create some sound-reactive LEDs in the form of an LED equalizer, or that is the aim of the final project.

At the moment, I am just experimenting with using a shift register to turn on the correct number of lights determined by a number passed over serial to the arduino.

Here is the code I have so far:

Code:
int data = 2;
int clock = 3;
int latch = 4;
int v;
int lights = 0;

void setup(){
  Serial.begin(9600);
  pinMode(latch, OUTPUT);
  pinMode(clock, OUTPUT);
  pinMode(data, OUTPUT);
}

void loop(){
  v = getSerial();
  lights = calculate(v);
  light(lights);
  lights = 0;
}


//processes serial input 
int getSerial(){
  if (Serial.available()) {
    //convert char to int
    v = int(Serial.read()-'0');
  }
  return v;
}


//works out the value to be passed to light() 
int calculate(int v){
  lights = (pow(2,v)-1);
  return(lights);
}


//turns on the required number of LEDs (supposedly) 
void light(int lights){
  digitalWrite(latch, LOW);
  shiftOut(data, clock, MSBFIRST, lights);
  digitalWrite(latch, HIGH);
  delay(10);
}

Now my problem arises when it comes to understanding how the binary is processed.

I have 8 LEDs in a row. If the "volume" is three, I need to turn 3 LEDs on. Because I am using a shift register, and because binary uses the formula 2^x, or in my case 2^v, 2^3 would be 8, which would turn on 4 LEDs, but seeing as I only need 3, I have to take 1 away.

However, this does not work as expected. For one LED, it works perfectly, but for more than one, the value passed to light() is 1 too small. If I change the line

Code:
lights = (pow(2,v)-1);

to

Code:
lights = (pow(2,v));

then it works fine EXCEPT for the case where the "volume" is 1, as obviously, the arduino works out 2^1, which is ovbiously 2, so it turns on the second LED.

I am guessing here, but does the issue arise when converting the char from the serial input to an int? Or is this not the problem?

If any more detail is needed, I will be happy to provide.

Thanks,

Sam
Pages: [1] 2