Show Posts
Pages: 1 ... 27 28 [29] 30
421  Using Arduino / LEDs and Multiplexing / 4 digit 7 seg LED on: March 02, 2011, 01:19:59 am
My 4 digit 7 seg LED has anodes for the lines and cathodes for each digit and the dots. Is my absolute only option to cycle through each digit? It that why they're so damn bright? It's no problem, I just want to make sure I'm doing it right.

Also, how do you set cathode pins? Like how do you switch them? In particular, when you're using 595's

Thanks.
422  Using Arduino / Project Guidance / Re: How to use millis function to turn led on for 5s then turn it off indefinitely? on: February 27, 2011, 11:16:46 pm
Quote
I dont want to use the delay function i want to use the Millis function?
Doesn't "delay()" use "millis()"?

perhaps he want to continue running code while it waits?
423  Using Arduino / Project Guidance / Re: New to Arduino, guidance on a simple syringe pump for my lab. HELP! FOR SCIENCE! on: February 27, 2011, 11:12:20 pm
I hope you're being careful... One misplaced zero and you've got a lab full of exploded coke fueled mutant rats!
424  Using Arduino / Project Guidance / 10x10 LED grid on: February 26, 2011, 10:02:42 pm
I want to have a grid of 100 LED's. They will be spread out to about 3x3 meters so I am concerned about excessive wiring, I want to find the most efficient way of putting them together. They need to be independently controllable, but I dont need PWM unless it wouldnt be too much harder. I thought maybe I could do it line by line, and just roll through the rows so i would only need 10 anodes and 10 cathodes, but then each LED could only be lit 1/10 of the time. And I wouldnt mind if I could expand the size so that would just get worse. Other than that I can only think to string a bunch of shift registers together, which wouldn't be completely undoable but it seems like there could be a better way.

Thanks.
425  Using Arduino / Programming Questions / Re: For loop, try again on: February 26, 2011, 07:41:40 am
perfect, thank you
426  Using Arduino / Programming Questions / For loop, try again on: February 26, 2011, 07:07:24 am
Im using a for loop to change an amount of items in an array. But it is changing them randomly, and I cant have to change the same one twice, so i need a dynamic way to keep from choosing the same number twice since I dont know how many of them will be changed at a time. Luckily I can easily see if it has already been changed by seeing if it equals 1. So i need to know how to "try again", or in other words, add another loop to a for loop.

Code:
for(int x = 1;x<=NumberToChange;x++){        //For how many items need to be changed
tempVal = random(0, arraySize)               //tempVal = a random items number
if (myArray[tempVal] == 1){                  //if the array item is already set to 1:
                                             //TRY AGAIN
}
else{                                        //if the array item is NOT already set to 1:
myArray[tempVal] = 1;                        //set the array items to 1
}
}

where it says //TRY AGAIN i need to tell it to attempt that loop again. Can i simply use x--?

thanks
427  Using Arduino / Programming Questions / Re: quick question about declaring an array on: February 26, 2011, 06:45:35 am
okay. thanks
428  Using Arduino / Programming Questions / Re: quick question about declaring an array on: February 26, 2011, 06:07:23 am
So I can't just declare it at the beginning of the loop? I have to use Malloc? Is the array freed at the end of the function automatically?

What I mean is, at the end of the function, Im done with the array. I entirely refill the array when the function starts again. So what do I need to do to free it at the end of the function?
429  Using Arduino / Programming Questions / Re: quick question about declaring an array on: February 26, 2011, 05:45:16 am
Oh okay, I just stupidly declared the array twice, trying to move it. So this is okay? :

Code:
void loop() {
Fade = map(AnalogInputValue,0,1023,0,Size);
int Array[Fade];
}

Is it okay if this value is different every time it runs the loop?
430  Using Arduino / Programming Questions / Re: quick question about declaring an array on: February 26, 2011, 05:33:54 am
Ugh, alright so upon trying it out, I seem to have found that the size of an array must be constant. Is there any way around this other than to remember how many values I want to use and ignoring the rest?
431  Using Arduino / Programming Questions / quick question about declaring an array on: February 26, 2011, 05:08:57 am
If I declare an array inside of my void loop(), can I change the number of items each time the loop starts over? I've only ever programmed in visual basic, and the array's there were much easier, i didn't have to worry about declaring its size.

And speaking of that, can I change the size of an array if its already declared?

Thanks
432  Using Arduino / Programming Questions / Re: Thoughts on how to program this array on: February 25, 2011, 08:25:03 am
Paul,
My only concern with that is, if I've got 100 LEDs and 99 are on and I need to find that last one by randomly checking, it may take 100 tries or more to find it. Let alone, all the other higher numbers, or lower as I'm going down.

Fletcher, that's a very good idea but ideally I would like it to be totally random whenever changing. So if you're at 50% then take it to 90% then back to 50% you'd have many different ones lit. I know I'm asking for a lot more complication, but I'd like to have it work like that if I can.

Thanks guys
433  Using Arduino / Programming Questions / Re: Thoughts on how to program this array on: February 25, 2011, 07:45:30 am
Now that I think of it, I'm thinking I could have two arrays. The OFF array and the ON array. Then move the LEDs from one to the other. Is this a good approach?
434  Using Arduino / Programming Questions / Thoughts on how to program this array on: February 25, 2011, 07:34:35 am
I'm not looking for someone to code it for me, just some ideas on how to approach it... I'm fairly amateur. 

Anyway, I want to have X number of LEDs and a potentiometer. As you fade the pot up, random LEDs turn on. So at half turned, a random 50% of the LEDs are on, at full turn, all the LEDs. 

Simple enough so far. But here's the thing, I don't want it to rerandomize all the lights as it fades up. I just want it to add to the ones already on. So no static TV look. So what I need advice on is how to efficiently figure out which LEDs are not on yet, then randomly choose an off one to turn on. 

Then there's the fade down, I need to find an efficient way to choose random on LEDs to turn back off as it fades back down.

So basically I need help on how to create an array, then how to interact with objects in that array based on their values, in groups. 

The fact that they will be LEDs is not important, I'm just interested on how to do these things with an array. 
435  Using Arduino / General Electronics / Re: Nixie Tube Transformer on: February 24, 2011, 01:10:13 am
ehh... I figured a different transformer would be easier but it's not looking that way. I think ill go with the lm317. Thanks guys.
Pages: 1 ... 27 28 [29] 30