Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 10, 2012, 07:32:35 am
Thank you sir, It sounds like it's exactly what I'm looking for. I will have to load it this evening to play with it.

Jeff
2  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 09, 2012, 08:37:12 pm
Yeah, it looks like I'm going to have to take a few steps back and get on the same page as everyone. I'm no where near where everyone expects me to be. All the advice that is given to me flies way over my head. I'm totally missing what apparently is staring me right in the face with this "blink without delay" sketch

I know that everyone that reads this is asking themselves, "Is he really that dense?" well the answer is emphatically yes

Please bear with me...
3  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 09, 2012, 07:22:06 pm
Quote
Can you clarify please?

4 LEDs. What do you mean by "cycle"? One and then the next, and so on? So only one is one at once? Or all flashing together? Or one on, then two on, then three on, and then four on?
One right after the other: STEP1 led1 on, STEP2 led1 off (same time) led2 on, STEP3 led2 off (same time) led3 on, STEP4 led3 off (same time) led4 on, STEP5 led4 off (same time) led1 on etc.

Quote
Quote
... and have it increase speed not by cycle completion but by time ...

What does that mean?
The current code increases the speed of the LEDs after every cycle (I define a cycle as when all 4 LEDs have lit up once) by 20 milliseconds
Code:
// lower the delay if timer >= 20
                  from 700 milliseconds
Code:
int timer = 700;   
                                                 to the targeted 20 milliseconds
Code:
if (timer >= 20) {
      timer = timer - 1;
    }
This code works well for the slower cycles but once the cycles start to speed up the rate at which 20 is subtracted becomes really quick it cascades to 20 rather quickly.

Quote
700 what? You mean 700 Hz? You wouldn't spot anything much over 25 Hz cycle.
I believe it's set in ms.

Quote
Inputted how? Keyboard? Knob? Serial port?
imbedded in the code
Code:
if (timer >= 20) {
      timer = timer - 1;
    }

4  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 09, 2012, 12:53:46 pm
Quote
you don't know how to formulate your requirements in a form that someone else could implement them
You're probably right because I'm not sure what this means.

Tell me if I'm way off when I say, "I want to take this current code that cycles 4 LEDs at a rate that increases as each cycle is completed by what ever value that's inputted and have it increase speed not by cycle completion but by time. For example: it starts at 700 and every second that passes it reduces by a factor of 20, in 5 seconds, it will reduce to 600 and so on, until it reaches a target value which in this case is 20.


Code:
int timer = 700;           // The higher the number, the slower the timing.

void setup() {
  // use a for loop to initialize each pin as an output:
  for (int thisPin = 2; thisPin < 6; thisPin++)  {
    pinMode(thisPin, OUTPUT);     
  }
}

void loop() {
  // loop from the lowest pin to the highest:
  for (int thisPin = 2; thisPin < 6; thisPin++) {
    // turn the pin on:
    digitalWrite(thisPin, HIGH); 
    delay(timer);                 
    // lower the delay if timer >= 20       
    if (timer >= 20) {
      timer = timer - 1;
    }

    // turn the pin off:
    digitalWrite(thisPin, LOW);   
  }
}

Now I know you want me to intruduce millis() and remove delay()

So here's what I know about delay(), when it's read it stops all other function until the task is complete. And I know that Millis allows other functions to take place at the same the same time other tasks are being completed. Which will be perfect to allow a counter to run while the LEDs cycle.

Let me also throw out a disclamer that this isn't for any school project, nor is it a project that is going to financially benifit me. It is just me trying to have fun with the Arduino. and as you can tell at this point i'm not having much fun. but dispite the rhetoric I'm learning quite a bit.

Jeff
5  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 09, 2012, 08:06:59 am
come on,  really?
6  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 09, 2012, 07:42:25 am
Quote
Maybe you're trying to teach me 5th grade algebra when I need to learn 1st grade addition. What's simple to you is not simple to me. and I'm sure if roles were reversed I'd bend over backwards to help you.
I think that where we are having difficulty is that we have no idea that you need help with 1st grade addition. So, we assume that its 5th grade algebra that you need help with, since that is what you are asking questions about.

If we answer the question(s) in ways that you don't understand, you bear some responsibility to let us know that. Berating people who are trying to help you isn't the best response.

If we know that your difficulty isn't with 5th grade algebra, but is more basic than that, we can back up and start with more basic answers.

If, on the other hand, we assume that, though the question was about 5th grade algebra, you don't even understand 1st grade addition, you'd be even more insulted, and rightly so.
can you please help me now?
7  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 09, 2012, 07:40:46 am
Wow! How did this thread escalate totally out of control? Halloween, I bet!

http://www.gammon.com.au/blink

Beware of the zombies.
Mr. Gammon,

now that looks like some information I can use. when I get to my laptop I will try to understand those codes that you have on your site. it seems like it's laid out in a way I can understand but when I start trying to apply it I will probably have lots if questions.

Thanks
8  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 11:51:04 pm
Quote
Do you mean one after another? All at the same time? Binary counter? Random? The answer is yes to all, but the implementation is different
I mean, one after another
9  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 10:53:25 pm
Quote
13 is convenient because most Arduino's already give you an LED connected to pin 13 through a series resistor, meaning you can upload the code to the board without adding any hardware. You're welcome to use whichever pin you like; you aren't tethered to pin 13.
understood, I changed it to 2 but I need to understand how to get 3,4 and 5 in there as well. so that I can have them blink with this code. Everything that I try gives me an error.
10  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 10:49:57 pm
Quote
Which is something that you learn to figure out by actually playing with the devices. If you can't figure it out, then you truly don't understand it enough; it's that simple.
You're right, I played with it and got the LED to blink at different intervals. Maybe you're trying to teach me 5th grade algebra when I need to learn 1st grade addition. What's simple to you is not simple to me. and I'm sure if roles were reversed I'd bend over backwards to help you.

Quote
The responses certainly haven't been warm and friendly, but calling it banter is a bit of a stretch.
I don't think that's a stretch at all. All I asked for was help but what I got in return was you guys trying to teach me how to read Greek.

Quote
here are many people who come here and can't understand it after an explanation and that's understandable.
Again, what is understandable to you if far from understandable to me.

Quote
is an apparent lack of effort, which is why you see posts about how quickly you respond with "looked at it, still don't understand it" type responses.

LACK OF EFFORT? Maybe you missed it but I spent well over 24 hours reading and trying to understand HIGH, LOW, int, boolean, array, if's, delays, millis etc and to apply the same examples that everyone pasted. I'm not an idiot, I can search arduino and google just as well and anybody. my problem is that I don't understand your language.

Quote
also a stretch. I think I characterized it pretty clearly when I said that we're not here to help you complete your project,
Show me? You're not here to help, you're here to give me your interpretation of some unwritten rule that you're "here to help but you're not really here to help". (which makes no sense to me)

Quote
we're here to teach you how to do it yourself.
If this is teaching me how to do it myself, you lost me when you said you're helping, all you're doing is parading around like you're better than me for the simple fact that I have no clue how to write code nor do I understand it at its fundamental root.

The thing that gets me is that you and everyone else that has read this, know what and how to achieve what I'm asking. However, instead of helping, all you want to do is belittle my intelligence.

The brain power and time it took you to respond you could have channeled that into a positive that actually would have HELPED me. Instead you chose to continue with the, "you don't understand what this site is all about" banter.

Look, I got it. You don't want to help me, but there are others that are willing to so please if all you want to do is continue down this road, save yourself some time and don't respond at all.
11  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 09:46:32 pm
Do I have to use const int ledPin = 13 to define the pin OR is there a way to define using pins 2, 3, ,4, and 5 as constants?  I am using the code from the Arduino playground, Blink Without Delay which starts with the constant using pin 13. 

Is there a way to string multiple pins in the blink without delay code?  OR is there a different code altogether that needs to be used in order to get all 4 LEDs working together with a millis (rather than a delay)?
12  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 07:53:26 pm
thanks for your input. it's not like I don't understand it, I just don't know how it would apply to what I'm doing.

 I'm not sure if everybody woke up on the wrong side of the bed or if my impression of everyone being on their high horse is just my problem, but a "something for nothing" lecture isn't what I expect when I asked for help.

I'm trying real hard to understand your guys way of thinking,  it occurred to me a long time ago that there are many different types of people and they all have different ways of understanding things. I'm sure I'm not the first person to come along that has a hard time understanding what you guys are saying, I'm sure those with thousands of posts have seen this many times my question is, do you run them off with banter such is this? or do you offer assistance? I for one think that a community such is this would be willing to help.

 myself, being an expert in other things and also being part of a web forum sort of like this I definitely don't answer questions with, "figure it out yourself we're just here to give you our opinion on how the site is supposed to be ran" attitude.

 I'm trying real hard to have an upbeat attitude with the type of replies that I have gotten, but this cloak and dagger, "here's a piece of the puzzle see how it fits" doesn't really sit right with me.

 this code is such a small aspect of my project that I was hoping that it wouldn't be this difficult for someone to help me.

13  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 06:37:45 pm
I had to walk away from it right now I'm not at home so I will take a look at it when I get home thanks
14  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 02:52:48 pm
Yes I can see how I can manually change the interval But I want to do it automatically.
15  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 02:34:56 pm
And that's what I don't understand, the blink is constant, how do I make it vary? and how do I apply that to what I have. I don't ubnderstand any of it.
Pages: [1] 2