Pages: [1]   Go Down
Author Topic: PWM slope with arduino ethernet  (Read 556 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4575
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks..

BUT I mean the coding for that... smiley-sad

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

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2811
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> 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

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Delete thread...I won't be back
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1189
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Then change it to increase your ramp value  instead of blinking     ramp = ramp +1  .

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

ditto for zero.
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4575
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Delete thread...I won't be back

LOL!

What did you think this was? A place where people write your code for free?

What did you try? Did you make any effort at all? Did you google for one of the hundreds of similar programs then try to adapt it? There's no sign of any of that in this thread...
Logged

No, I don't answer questions sent in private messages...

Pages: [1]   Go Up
Jump to: