Show Posts
Pages: 1 2 3 [4] 5 6 ... 57
46  Using Arduino / General Electronics / Why use 2 decoupling capacitors? on: August 30, 2012, 09:26:23 am
I've seen posts here that talk about the low component count of the MAX7219 only needing 2 capacitors, and I've always used it with a 0.1uF cap across the power supply, so I wondered why they said it needs 2.  I finally looked at the schematic that keeps getting linked and it has a 10uF and 0.1uF cap in parallel across the power supply.

What is the purpose of doing it that way?   I understand that the 0.1uF is intended to smooth short, sharp voltage spikes and using a 10uF is intended to smooth out ripples over the longer term, but won't the 10uF also deal with the spikes if used alone?  It's not like the 0.1uF will act faster or anything. 

47  Using Arduino / General Electronics / Re: Using BCD 7 - segment decoder with PWM on: August 29, 2012, 11:00:52 am
First of all, the 7 segment chips you're talking about decode with a font, for example if you input an 8, you get all 7 outputs high.  If you you output a 1, you'll get the a and b outputs high. 

The device you want is a decoder.  Look at the 74138 3 to 8 decoder or 74154 4 to 16 decoder.  Maybe it's fast enough that you can PWM the chip enable, check the datasheets.  I still don't think your idea will work, at best you only have one output enabled at a time, so you only have the PWM signal present for a fraction of the time depending how many outputs you want.

The correct way to add some PWMs is with a port expander, you might start with the MAX7313, but find one that meets your needs.  They are very easy to use and attach to the Arduino's I2C bus. 
48  Using Arduino / LEDs and Multiplexing / Re: Charlieplexing a row of LED's on: August 28, 2012, 08:12:52 am
I'm just kind of curious why you're using charlieplexing for your original goal.  If you have 4 groups of 6-10 LEDs, why not control each group off an I/O pin with a transistor to provide enough current?  This will make your code trivial and charlieplexing 40 LEDs means you have a 2.5% duty cycle so may have a brightness issue.

Even if you want to control each LED individually, 40 LEDs only takes 13 IO lines for a normal matrix configuration (vs 7 to charlieplex) and you benefit from simpler code and better duty cycle.  If you're that short on IO (which doesn't appear to be the case here), you can use a decoder or shift register to reduce your IO pin count.

49  Community / Bar Sport / Re: What do you guys use? on: August 25, 2012, 12:54:42 am
Mac OS at the moment but the way apple is abandoning the mac, I'll be switching to PC pretty soon.
50  Community / Exhibition / Gallery / Re: Arduino + FreeRTOS + C++ = Platform for Teaching Real-Time Software Design on: August 21, 2012, 10:08:31 pm
This is very interesting.  When I took a grad course in real-time programming we started by coding a simplified version of the project on bare hardware (a 486 if I recall), just to show how hard it is, then we wrote our own real time OS and developed a feature-rich version of the program.  I think it was having a GUI and maintaining the real time hardware control that made the OS a blessing.

I remember struggling over coding the memory manager (which paid off when I interviewed with Microsoft's NT Kernel group and had to design a virtual memory manager on a white board in front of a panel of interviewers).  Without the RTOS you simply wouldn't have a memory manager; it wouldn't be a matter of being more complex to not have the OS.  I can't imagine why you'd even want to try to deal with paging within application code.

For the scope of what you can do with an arduino, I think simply using timer interrupts will let you do anything you could possibly want with real time, but I do understand that's not the point of your post.
51  Using Arduino / Sensors / Re: RS232 on: August 21, 2012, 09:40:39 pm
I'll do the search for you.

Oh wow, sparkfun is getting pricey.

Obviously I can't vouch for the seller, but there's a ton of options on there.
52  Using Arduino / Programming Questions / Re: Sketch works with one button but not 2 on: August 21, 2012, 09:30:09 pm

Your code is atrocious to try and read.  Even stuff like your if statements, why the explicit "== HIGH" on only one branch?

I'm pretty sure your problem is that you're setting your state variable wrong.  I don't think

state = 1 - state;
state = 2 - state;

is doing what you think it is.  But because of how poorly written your code is, it's hard to say.

Your if's and else's make no sense.  If state = 1, doesn't that guarantee the last thing you do is execute the else for state = 2 so you'll never even see the result of your state = 1 portion?

53  Using Arduino / LEDs and Multiplexing / Re: Problem with led matrix array on: August 21, 2012, 09:14:51 pm
The schematic of the Matrix is really simple. There are 5 rows with 7 led each. The rows have a common gnd ant the columns have a common anode.
I use 330R resistors. Everything is connectet to the digital pins of my Arduino UNO.

If you can't tell us what you're doing, nobody can help you and this thread is an exercise in frustration.  How is the matrix connected to the Arduino?

Everything is connected to the digital pins?  Directly? so rows and columns?  The Arduino outputs can only sink or source 40mA, which is not enough to drive a full row (or column) as you can.

If you have resistors on the rows and columns, you are splitting your current among whatever LEDs are on on that row (or column) so the brightness of each row (or column) will depend on how many LEDs are on and will not be consistant across the matrix.
54  Using Arduino / Programming Questions / Re: Don't know why this isn't working (DeBounceing) on: August 07, 2012, 12:23:37 am
Did you mean to use i for your iteration variable and buttonPin as your paramenter to digitalRead?

for (int i=0; i <= 9; i++){
// read the state of the switch into a local variable:
int reading = digitalRead(buttonPin);
55  Using Arduino / Programming Questions / Re: minimum delay on: August 02, 2012, 09:46:06 pm
I think what Wizened was saying is it is simply impossible for any device to raise a voltage level in 0 time.  In any square wave, the signal takes some time to go from 0 to x.  The sides of the square wave are never truly vertical.  It has nothing to do with Arduino, it's a physical reality.

Why don't you tell us what you're trying to do and we can help you out more?
56  Using Arduino / Audio / Re: Compare two analog input signals on: August 02, 2012, 09:19:34 pm
Please don't cross-post.
57  Using Arduino / LEDs and Multiplexing / Re: Comparing two analog input signals and outputting a digital signal on: August 02, 2012, 09:14:55 pm
I'm not sure what's confusing you.  Wouldn't it basically be:

var1 = analogRead(0);
var2 = analogRead(1);
if (var1 > var2)
 digitalWrite(pinOut, HIGH);
 digitalWrite(pinOut, LOW);

As long as you're using a 5V arduino your 0-5v will be scaled from 0-1023.
58  Community / Bar Sport / Re: Ardunio C++ SUCKS!!!! on: August 02, 2012, 08:31:24 pm
I can't help feeling like I'm feeding a troll here, but if you really don't like C++, I suggest you look into JAL for the PIC microcontollers.   It's a pascal-like language but simplified for easy programming.  The developer has also created a bootloader, target boards and a set of modules he calls dwarf boards to add hardware, much like shields.  There are also picaxe devices you can look into which are pic microcontrollers with a BASIC intepreter/bootloader preinstalled.  That might be more your speed.

I actually came from JAL to Arduino about 6 years ago, specifically because I preferred the extra power and functionality C++ provided.  Things that were quite difficult in JAL such has dealing with timer interrupts and using the CCP module are trivial with Arduino.  Over the past 6 years I've been amaze at the quality and volume of libraries that have been donated to the Arduino project, but if you see the libraries as a hindrance you might be a lot happier in JAL.

If I have any complaint about Arduino it's that it's made everything so easy that even when I know a small program on a pic10F is the better way, I still go for the arduino out of laziness.

I do come from a computer science background so when you talk about the limitations of C++ you really do sound ignorant, I strongly suggest you read up on structured programming and why it's a good thing.  C++ also does allow you to use gotos, and I won't even say you shouldn't, but you better understand why most people say you shouldn't before you do.  C++, while being structured also does give you far more control over the flow of your program than most languages, it is extremely powerful, but with that power, it's also very easy to shoot yourself in the foot.
59  Using Arduino / LEDs and Multiplexing / Re: Driving 14 or 16 segment LEDs on: August 02, 2012, 08:53:43 am
Thanks for your reply.  I did look at the data sheets for the MAX6654/6655 type chips, they seem quite a bit more complicated to use than the 7219 because they try to be so much more versatile; more LED arrangements, a built in port extender, etc.  I also don't think I can get them in through-hole which might be a problem for me.

Those chips also support 128 LED segments which is one reason for the complexity.  From your post, can you point me at any drivers that do 1 or 2 digits?  I only need 4 digits so that won't be so bad for me.

Using 2 shift registers, a transistor array, and resistors will up my component count a lot.  Programatically, I'd use a timer interrupt handler to do the multiplexing so I could have a set-and-forget interface which I find a lot cleaner than blink-without-delay, but that whole scheme seems so inelegant.  I'm just surprised it's such an easy thing to do with 7 segments but so hard with 14.

I thought the 14-segment display would be a pretty solution, but it's at the point where I'll probably just go with a character LCD.
60  Using Arduino / LEDs and Multiplexing / Driving 14 or 16 segment LEDs on: August 01, 2012, 01:01:53 pm
Is there a good way to drive 4 14-segment LED's?  I'm looking for something comparable to a MAX7219.  I'm aware of the option of using a couple of shift registers and a transistor for each digit, but would prefer a driver that takes care of all the multiplexing and current drive for me.  I've seen SMD chips that will handle 8-digits but I need through hole parts. 

Pages: 1 2 3 [4] 5 6 ... 57