Go Down

### Topic: PWM slope with arduino ethernet (Read 1 time)previous topic - next topic

#### drewpalmer04

##### Jan 07, 2013, 08:31 pm
Any ideas on how to accomplish a 0-255 slope over 8 hours and then back down again at the end of the time frame?

I have two PWM drivers for LEDs and need them to slowly slope over the duration and then back down again for night time.

THANKS!

#### fungus

#1
##### Jan 07, 2013, 08:42 pm
1) Find out how many milliseconds are in 8 hours.
2) Divide that number by 255.
3) That's how often you need to go up a step.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#### drewpalmer04

#2
##### Jan 07, 2013, 08:49 pm
Thanks..

BUT I mean the coding for that...

Clueless how to code that...I figured the math out

#### Docedison

#3
##### Jan 07, 2013, 11:38 pm
Uh... I know, I'll Get a Book...   Naah, That is *money* I Think I'll search Google for that Free Wiki course on C++...

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

#### drewpalmer04

#4
##### Jan 08, 2013, 04:44 pm

Uh... I know, I'll Get a Book...   Naah, That is *money* I Think I'll search Google for that Free Wiki course on C++...

Bob

Man this forum isn't anything more than a bunch of smack talk. For whatever reason...I'm learning...MY BAD

#### Boffin1

#5
##### Jan 09, 2013, 02:13 am
If you are still around,  have a look at blinkwithoutdelay in the example sketches, play with it to blink at the interval you have calculated.

If  ( theres the clue ) it gets to 255 , make it reverse.

ditto for zero.
45 years of editing projects with a knife and soldering iron, then I found Arduino !

#### fungus

#6
##### Jan 09, 2013, 08:02 am

Man this forum isn't anything more than a bunch of smack talk. For whatever reason...I'm learning...MY BAD