Hi,
For anyone trying to get the Audino project to run and finding that only pot 4 changes anything, you need to add the volatile keyword to the variable declarations. My assumption is that a new compiler optimisation in Arduino 1.0 is replacing the variables inside the ISRs with local (register based) copies which are not updated by the analogReads in the main loop.
I have left a suggestion to this effect on the Audino project page for the project owners.
I am just breadboarding the project at the moment with a mismatch of components, once I have a suitable set up to confirm the results I will post my suggestion for an Arduino 1.0 compatible version, in the meantime you can add volatile to all of the global variables as such -
For anyone trying to get the Audino project to run and finding that only pot 4 changes anything,
I do not understand the problem.
Why should we make all global vars volatile?
Vars need only be volatile to prevent the compiler from optimizing them with registers.
Typically used in synchronization issues between a main program and ISR's (and probably some other cases).
You will see that there are a set of global variables that set the synth parameters in loop.
These same global variables are used in a timer driven ISR to create the synth output.
The code does not work correctly for me as it is presented on the site, the analogue inputs have no effect. On reading through the code it looked quite likely that the global variables are being optimized in some fashion that the copies in loop are not updating the copies in the ISR. On this basis I added volatile to the variable declarations and now all analogInputs are correctly controlling the synth parameters.
I do not understand the problem.
Why should we make all global vars volatile?
Vars need only be volatile to prevent the compiler from optimizing them with registers.
Typically used in synchronization issues between a main program and ISR's (and probably some other cases).
Indeed.
That is all that needs to be made volatile and it was always thus.
While it may have always been so, it is not so in the Audino code which is my I am suggesting this fix.
That is because they are used in both loop and the ISR.
Can you name another variable that needs to be made volatile for it to work?
You are correct that the code needs those (above), and therefore the code on the site is wrong. But that is simply because those ones are the ones that are shared between inside an ISR and outside an ISR.
This isn't what I was planning, but I have been out and accidentally bought a nice rugged clear topped enclosure. It was way too expensive but seeing the clear top I couldn't get away from the idea of combining the Audino with an LED Chaser/visualizer of some sort. The Audino only uses timer2 so that leaves me 0 and 1 for PWM, I also picked up some hex drivers and 4017's for chasers.