ShareBrained Technology Forum Index ShareBrained Technology
Give a little, take a little.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Heavily modified code to allow several options.

 
Post new topic   Reply to topic    ShareBrained Technology Forum Index -> Code/Circuit Hacking
View previous topic :: View next topic  
Author Message
kdbrown



Joined: 13 Aug 2009
Posts: 12
Location: Canada/Vancouver Island

PostPosted: Tue Jul 20, 2010 4:51 pm    Post subject: Heavily modified code to allow several options. Reply with quote

I keep forgetting to post this, but I took Jared's code and modified it to have several options:
Code:
1) Added the compile-time switch PHASE_CORRECT to select a different PWM mode for the two outputs. The main advantage of the different mode is that there is no output pulse at a value of zero. This means that power-off mechanical zero calibration is sufficient for the "left end" calibration. Since the divisor is a multiple of 510 vs 256, some extra work has to be done!;
2) Added MINUTES_DOWN so that reverse/upside down meters can be used. Note that this does not change the polarity of the signal, rather it changes the output-with-time direction;
3) Added HOURS_DOWN similarly;
4) Added TWENTY_FOUR_HOURS to select a 24 hour clock display.
5) Added up-edge switch debouncing. This makes it more tolerant of switch noise;
6) Put in a second=0 statement to clear the seconds when minutes are set;
7) Added in another option, CONTINUOUS_HOURS, to do the hours "continuously";
8) Added in yet another option, CONTINUOUS_MINUTES, to do the minutes "continuously". 

As far as I know, all 6 options can be turned on independantly, giving 2**6 new modes of operation.
If anybody wants too get their hands on the code, just ask me and I will send it to you, however be forewarned that I also modified the code to work with the AVR Studio and an attached programmer: it does not work as an Arduino anymore. (In fact I could not get my board--a non Sharebrained one, to work as an Arduino at all, whatever the problem was. Since I already had the Atmel tools at hand and have experience with them, I prefered to use what I had and knew.) If there is enough interest then I will post the code somewhere instead of emailing it upon request.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ShareBrained Technology Forum Index -> Code/Circuit Hacking All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP