Show Posts
Pages: 1 [2]
16  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 02:26:44 pm
Quote
Quote
Is it simple to do?
Yes.
Will I write it for you?
No.

We operate on the "teach a man to fish" principle.
I can see that's how you operate, tossing links at me isn't teaching me anything that google search can teach me. I'm willing to bet that there are others on this forum that see my frustration and will teach me to fish in a manner that I'm willing to learn.
17  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 02:20:52 pm
Quote
Oh, and you have the memory of a goldfish.
I get it, "who is this guy that just started an account and expects us to help him?" I'm hoping for some real help, not links to other projects that may work, if I know what and how to extract and apply it here I would but like I said that's not how I learn.

What I'm hoping for is:
 "here try this simple code: [code ] [code/ ]
see how the xx changes as you change xx? Try xx and see how xx speeds up and xx slows down, that is xx at it's simplest form"
 
I understand that analogy but how does it apply?
18  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 02:07:12 pm
Wow!! Is a moderator seriously insulting me?
Unless this is your way of trying to teach me something, I would expect more from a moderator.

here it is in easy to understand terms:

start with 4 LEDs set in output pins 2-5.

start by chasing each other one after the other at the rate of XX cycles per minute (cpm).
the chasing increases at the rate of XX cycles per second (cps) until it reaches XX cpm
once that cpm is met then it decreases speed by XX cps until XX cpm are met.
It does this over and over and over and over again.

That's the goal I'm trying to achieve here.

Is it simple to do?

If boiling eggs for 3,4,5 minutes is supposed to mean something explain it to me...
19  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 01:49:36 pm
quite a few, I spent just about my entire weekend trying to come up with something and I know that I'm frustrated to the point that I enlisted the help of the arduino community. I tried playing with quite a few IDE but I can't bridge the gap to applying it to what I have, I always get errors and can't figure out why (which isn't a far stretch).

There are a lot of things that I'm good at but this isn't one of them. Please help me...
20  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 01:31:02 pm
I guess what i'm looking for is someone to take what I have... or scrap it all together and help me with cycling 4 leds from 30 cycles per minute to 2000 cycles per minute at the rate of 1 cycle per second.


Lets use what I have as example and move from there. All these links are great but I would much rather understand it at a pace that I can see results with what I have.

I know it requires less work for me and more work for the arduino community, but the "more work" part for you is easy because you understand it, I don't. if it were more work for me I would have to devote more time than I have to doing this
Thanks Guys

Jeff

21  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 01:23:14 pm
I guess I have no clue what I'm doing, nothing makes sense. Thanks for trying to help.
22  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 01:09:41 pm
Ok, just as I expected, it makes zero sense to me. Let me say that I don't know how to write or read code, I learn best by taking something and changing values to see what I changed, then things me more sense.

how would I apply millis() to my current project.

I'm going to need you guys to hold my hand before I feel comfortable with doing things myself.
23  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 01:01:53 pm
So you mean I have to read and understand code that makes no sense to me? smiley Ok I'll try... But be ready for lots of questions!!!
24  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 12:47:30 pm
Thanks paul, do you have a link to millis()

and when I removed delay() the LEDs all lit up and stayed on.
25  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 12:19:08 pm
Quote
but I want to have it all programmed and watch it do it automatically
You can programmatically change the value of the variable called timer.

The variable called timer has nothing to do with any timers, so the name is a poor choice for a variable.

dwell or interval or waitSomeTime would all be better choices.

Loop index variables are typically one letter names, like i, j, k, etc.

I sort of getting what you're saying but will changing timer to dwell, interval do anything different to the code?
26  Using Arduino / Project Guidance / Re: cycling 4 LEDs at varrying speeds on: October 08, 2012, 12:13:46 pm
Awesome thanks for the help. I played with changing some of the values and I get the lowering the delay by 10 every cycle (sorry for the lack of lingo) and it works well until the cycle times speed up then it cascades to max speed rather quickly.

Is there an easy way to have it increase based on time and not cycles? for instance: have it increase by 10 every second instead of cycle?

Oh, and yes I have resistors in line of my LEDs.
Here's what I have so far:

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);   
  }
}
27  Using Arduino / Project Guidance / cycling 4 LEDs at varrying speeds on: October 08, 2012, 11:03:56 am
Hello all,

I just purchased my first arduino uno and I'm eager to learn as much as possible.

I just put 4 LEDs on pin 2-5 and they share a ground on the board. What I want to do is have these 4 LED's chase each other at varying speeds that can be written in the code.

ie. the LEDs chase each other at the rate of 50 cycles per minute and then gradually go from 50 to 2000 cycles per minute at the rate of 10 cycles a second, and then back down to any variable lets say 500 cycles per minute.

Here is the code that I have right now, It's a varition of this code as you can see I can change the speed manually by changing int timer = but I want to have it all programmed and watch it do it automatically:



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);                 
    // turn the pin off:
    digitalWrite(thisPin, LOW);   
  }
 
}

Pages: 1 [2]