Arduino based passive analogue input selection & volume control
Nov 18, 2009 at 8:46 AM Post #106 of 123
To keep you updated:

The boards are ordered (change some little details). So expect some nice action shots next week or one week later.

LCDuino is laying at home, waiting for a task. I need my preamp, missing my music.

Case is designed and planned but not ordered yet.

So in the next future there will be a bunch of updates.

wink.gif
 
Nov 18, 2009 at 4:17 PM Post #107 of 123
Quote:

Originally Posted by linuxworks /img/forum/go_quote.gif
so, I do suggest having whatever vol control chip you are using be behind a PE chip of some kind.


heh, a little comment happy
smily_headphones1.gif


SPI_write(left /*<< 1*/); // left value (0..255)

I've never been a fan of K&R style formatting.. just too inconsistant for me... thus, much more of a 1TBS guy myself.
tongue_smile.gif
Ah, the joys of tidy though, one second it's K&R and the next second its beautiful.
 
Nov 18, 2009 at 5:36 PM Post #108 of 123
just to explain: I first was saving the volume in 'full db' steps (which ends up being 0..127 as a range and then shifting over to the left 1-bit to make it 0..255 before sending out to the pga chip).

last week I added a new feature to let users pick if they wanted half or full db steps. and so until I was sure things worked, I commented out various parts and left them that way (reminder) should I need to undo this fix.

anyway, that's why there was a left shift there. if you count in half db, each up-vol event adds 1 and each full db event increments by 2. no shifting is done (anymore) at the final output stages.

fwiw
wink.gif
 
Nov 18, 2009 at 6:24 PM Post #109 of 123
Quote:

Originally Posted by luvdunhill /img/forum/go_quote.gif
I've never been a fan of K&R style formatting..


lol, for me it's the other way around.
I am actually quite pedantic about this. If it's C code, I use only K&R stylc commenting. If it's C++, then I use the double slash. gcc doesn't care, but years of cross-platform code development has taught me that not all compilers are so tolerant, so I don't mix things.
 
Nov 18, 2009 at 6:30 PM Post #110 of 123
Quote:

Originally Posted by amb /img/forum/go_quote.gif
lol, for me it's the other way around.
I am actually quite pedantic about this. If it's C code, I use only K&R stylc commenting. If it's C++, then I use the double slash. gcc doesn't care, but years of cross-platform code development has taught me that not all compilers are so tolerant, so I don't mix things.



I wasn't referring as much to the commenting (which I agree 100% with you on), as the brace convention
smily_headphones1.gif
 
Nov 18, 2009 at 6:38 PM Post #111 of 123
the brace style is also FORCED by the arduino ide/guii ;(

if you do a reformat inside the gui, it doesn't just fix indents, it changes other things! which I don't agree with..

I have .emacs settings that I've used for years. when I need to clean up the formating (mostly spacing) I exit the gui, pull all the files into emacs, do an indent there, save and then re-start the main IDE again. I only do that when things change a lot (not very often).

someday I'll setup a command line build environ; but most users will use the gui and so I should also do the same thing they do, for better testing if nothing else.
 
Nov 18, 2009 at 6:41 PM Post #112 of 123
as for KR vs ansi, I do prefer ansi style indenting.

when I try things like:

if (a) {
a1();
} else {
a2();
}

which I consider nice and concise, the IDE gui messes it up and breaks my single-line else into 2 lines!

so there is no KR or ansi about it; its an arduino thing. sadly, the arduino guys felt that some reformating should be part of their re-indent command.
 
Nov 18, 2009 at 6:43 PM Post #113 of 123
Quote:

Originally Posted by linuxworks /img/forum/go_quote.gif
someday I'll setup a command line build environ; but most users will use the gui and so I should also do the same thing they do, for better testing if nothing else.


in fact, I just did that last night.. Agreed, the Java Arduino IDE is pretty pseudo. Anyways, not really all that painful of a process really, just sorta worked.
 
Nov 18, 2009 at 6:45 PM Post #115 of 123
Hmm, ok, here were no braces in the code snippet above... Anyway, I used to work on Unix kernel source code which (from Bell Labs/AT&T/USL) were strictly K&R style and with one tabstop per indentation level, and it stuck with me for my own work. OTOH, when I work on someone else's code I use whatever convention is aleady there. My peeve is when there is no convention. Such as mix use of tabs and spaces for indentations, inconsistent indentation spacing, mixed use of braces styles, etc... argh!
frown.gif
 
Nov 18, 2009 at 6:57 PM Post #116 of 123
Nov 18, 2009 at 9:12 PM Post #118 of 123
Quote:

Originally Posted by linuxworks /img/forum/go_quote.gif
...so until I was sure things worked, I commented out various parts and left them that way (reminder) should I need to undo this fix.
fwiw
wink.gif

...



They have this new-fangled software out now that takes care of this for you...I think it is called source code control software
wink.gif
. I have all of your web-available versions in Subversion so I can keep track of the changes you are making.

As for style, I abandoned the arduino sketch environment almost immediately because I can't stand K&R formatting. Even though K&R was the way I learned C back in 1982, I branch volumaster and reformat to ANSI for my working copy. I am currently using kdevelop for editing.
 
Jul 26, 2010 at 12:24 PM Post #119 of 123
Sorry to bump an old thread but did anything become of this?
Just curious as I've designed pretty much the same thing, got PCBs and just waiting for some components to test it out....I'll use an Arduino too.
 
Jul 27, 2010 at 3:36 AM Post #120 of 123
Yes and no.
 
All PCBs are finished and ready to run. I still have not begun to program the whole thing - but that should not be the problem.
 
Unfortunately I have managed to totally, really totally mess up the power supply. This hinders any real advantage. I think I will come back to this project in fall.
 
If anybody is interested to test the outcome, feel free to send me a message.
 

Users who are viewing this thread

Back
Top