Go Down

Topic: "Waking up" waveform (Read 1 time) previous topic - next topic


I'm looking for a waveform to drive the brightness of leds so the appearance is that the device with the leds is "waking up". I've done a lot of searching and run off on a lot of unproductive tangents. I have to think that many before me have used creative waveforms in a variety of projects. Any ideas on what to search on ?

I'm thinking of a waveform that has a steep, probably linear  rise to get to max brightness and then some sort of rolloff or decay as the brightness diminishes.

This is for a Stars wars like light saber that I have built, programmed and is complete except for this part. I would like for it to "wake up" as a prelude to the light show.


Here ya go buddy. Got this from "Getting Started with Arduino" Book. Have fun! hopefully it'll help... :)

// Copy and paste this example into an empty Arduino sketch

#define LED   9 // the pin for the LED
int i = 0;      // We'll use this to count up and down

void setup() {
  pinMode(LED, OUTPUT); // tell Arduino LED is an output

void loop(){

  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LED, i);      // set the LED brightness
    delay(10); // Wait 10ms because analogWrite
               // is instantaneous and we would
               // not see any change

  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LED, i); // set the LED brightness
    delay(10);           // Wait 10ms



Thanks, but I'm way beyond that. I've looked at sine, ramp, exponential and combinations and still haven't found what I want. I have and I suspect many others as well seen what I want in Disney and other children's clips.

Thanks for the thought though.


So why not just write that in setup?
Take ebird97s code, increase the count by 10 instead of 1 so it goes up quicker, than change direction and ramp it down by increments of 1 or 2 down to whatever your pre-show level is.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up