Head-Fi.org › Forums › Misc.-Category Forums › DIY (Do-It-Yourself) Discussions › Arduino based passive analogue input selection & volume control
New Posts  All Forums:Forum Nav:

Arduino based passive analogue input selection & volume control - Page 8

post #106 of 123
Thread Starter 
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.

post #107 of 123
Quote:
Originally Posted by linuxworks View Post
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

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. Ah, the joys of tidy though, one second it's K&R and the next second its beautiful.
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
post #109 of 123
Quote:
Originally Posted by luvdunhill View Post
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.
post #110 of 123
Quote:
Originally Posted by amb View Post
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
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.
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.
post #113 of 123
Quote:
Originally Posted by linuxworks View Post
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.
post #114 of 123
did you setup a windows or linux environ?

and so, you can now just type make and get a .hex file?
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!
post #116 of 123
Quote:
Originally Posted by amb View Post
mixed use of braces styles, etc... argh!
K&R is a mixed brace style. 1TBS is the true religion

Indent style - Wikipedia, the free encyclopedia

I set it up in cygwin. Here's the make file I modified:

http://www.arduino.cc/en/uploads/Hacking/Makefile

There's even a "upload" target.

Also, check this one out:

http://arkku.com/misc/arduino_make.sh
post #117 of 123
Quote:
Originally Posted by luvdunhill View Post
K&R is a mixed brace style. 1TBS is the true religion

Indent style - Wikipedia, the free encyclopedia
Point well taken!
post #118 of 123
Quote:
Originally Posted by linuxworks View Post
...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
...
They have this new-fangled software out now that takes care of this for you...I think it is called source code control software . 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.
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.

post #120 of 123
Thread Starter 

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.

New Posts  All Forums:Forum Nav:
  Return Home
Head-Fi.org › Forums › Misc.-Category Forums › DIY (Do-It-Yourself) Discussions › Arduino based passive analogue input selection & volume control