Forum Index > Projects > Clock Kits
 Night time autodimming code
 |  Printable Version
By: Anonymous: Tim () on Thursday, May 19 2011 @ 06:53 AM PDT (Read 4161 times)  
Anonymous: Tim

Hi everyone,

Below is the code for autodimming the Bulbdial during a certain time period, all you have to do is change defines at around line 76 and everything should work perfectly.

It allows you to:
- set the range of hours you want it to be dimmed
- set the level at which it dims from 0-8 (it will automatically revert back to the previous level after the time range)
- see the dimming level (except 0) when setting the clock's time
- disable the feature completely by commenting out line 76

One change to the original code is at line 1472 (or 1542 of attached version), where "MainBright" was replaced by "tempbright". Other changes are for allowing 24 hour mode and the stuff mentioned above.

This kit has been awesome fun. Thanks Evil Mad Scientist Labs! Big Grin

Download link: http://dl.dropbox.com/u/13733336/Beady2_Autodim.pde
(attachments not working for me)






       
   
By: squall_line (offline) on Thursday, May 19 2011 @ 10:36 AM PDT  
squall_line

This is me being a curmudgeon and kind of a geek/jerk, but...

Next step should be adding code so that a person can set the auto-dim time/feature using the buttons on the clock, instead of by plugging it in for re-programming. Wink

Kudos on what you've done so far! Smile


Forum Mad Scientist
Mad Scientist

Status: offline

Registered: 04/13/10
Posts: 96
Iowa, USA

Profile Email    
   
By: Windell (offline) on Thursday, May 19 2011 @ 10:52 AM PDT  
Windell

That's actually a clever approach-- to make the autodim times preprogrammed --one that I hadn't thought of.

squall_line 's suggestion (adding a user-interface option for this) is also good, but sounds a bit challenging. The menu is tricky enough, as-is. Wink


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: GoatRider (offline) on Thursday, May 19 2011 @ 07:38 PM PDT  
GoatRider

That's brilliant! It doesn't need a detector to know when it's night, it already knows what time it is!


Forum Henchperson
Henchperson

Status: offline

Registered: 01/12/07
Posts: 25

Profile Email    
   
By: Anonymous: Meviar () on Sunday, October 02 2011 @ 03:39 AM PDT  
Anonymous: Meviar

I have a problem when i set the autodim to 0

and dimhour to 0

and undim hour 7

when it dimming between 0 and 7 hour then i cant change the time because when i am in time setting mode the autodim sets the dimming to 0 so i cant see a thing maybe you can make that when autodim is 0 and you enter timesetting the autodim is 1 so you can edit the time.





       
   
By: squall_line (offline) on Sunday, October 02 2011 @ 11:48 AM PDT  
squall_line

Quote by: Meviar

I have a problem when i set the autodim to 0

and dimhour to 0

and undim hour 7

when it dimming between 0 and 7 hour then i cant change the time because when i am in time setting mode the autodim sets the dimming to 0 so i cant see a thing maybe you can make that when autodim is 0 and you enter timesetting the autodim is 1 so you can edit the time.



The clock should un-dim after you pass 7 AM, so as long as you're not trying to set the time between midnight and 7 AM, you should be fine.

Alternatively, edit the code to do this; it's open-source.

Who sets their clock in the middle of the night anyway? Wink


Forum Mad Scientist
Mad Scientist

Status: offline

Registered: 04/13/10
Posts: 96
Iowa, USA

Profile Email    
   



 All times are PDT. The time is now 05:58 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?