I have 56 7-segment LEDs being multiplexed using this format. Had to write my own muxing code.
You may be better off with 2 MAX7219's, each can control 64 LEDs, and you can control each one individually.
The MAX7219 takes care of the multiplexing for you, all you have to do is write to 8 registers in each chip; each register controls the state of 8 LEDs.
The Mega has 4 Vcc pins, so it can control up to 800mA of current.
The USB port only supplies 500mA, and the 5V regulator will get pretty warm and may shut down if sourcing that much current, even with a 7.5V source.
Having 5V supplied to the MAX7219 in parallel with the Mega would work much better.
In the time you have spent debating this, you could have bought yourself several $1.60 LED multiplexing chips, which will solve both your power problem and your pin problems.
It may also be a question of confidence as they are new to this. Why go through the hassle of buying and ordering something, hooking it up (possibly incorrectly), and spending a large amount of time getting something to work that isn't the right solution anyway?
It sounds to me like the OP needs to go through some basics, gain more confidence and understanding (using just a few IO pins for now) and then make a decision later.
General theory will be the tougher of the two. I would suggest going through the File/Examples in the Arduino programming software and then following the examples (to the T). Once you successfully do that, come back with specific questions such as "Why do I have to have resistors with LED's, why do I need an NPN and not a PNP here. Etc.
Okay... You already said my question... What is the difference between npn and pnp? Also, what are the parameters of the transistor and how to calculate what transistor do I need?
Rob3rt:
Okay... You already said my question... What is the difference between npn and pnp? Also, what are the parameters of the transistor and how to calculate what transistor do I need?
This tutorial covers the topic in great detail. It will explain:
How to select a transistor.
When to use NPN and when to use PNP.
What resistors you need and why.
Rob3rt:
Ok... How about serial connection? Can it go through the same usb cable for powering or do I have to use an usb to rx tx?
Sorry can you say that again it doesn't make sense.
The USB cable can carry power and serial signals for communication, nothing to do with lighting LEDs.
Well yea, thats kinda off topic but I didnt want to start a new thread. Can I use serial communication through the powering usb cable and arduino software listener for serial data?