If you study the Atmel datasheet for whatever MCU you are using you will discover that all these things
ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
are register names and bit names within the registers of the microprocessor.
Personally I find this notation very opaque and I prefer to write my code in the style ADMUX &= B01001010 where the 1s and 0s directly correspond with the bits. (By the way B01001010 is just random stuff for example purposes).
Yes I'm more or less clear with ADMUX register "configuration". Despite I don't know what the "_BV" means
Your notation is quite interesting because it remind the configuration of each bit each time you write it. But what I don't understand in this case is the "&="
But what about the rest : "ADCSRA |= _BV(ADSC);"
I wonder where the "1125300L" come from ?
The calculation is set out at the end of the line.
You're quite correct however, is should be 1024, not 1023.
I'm not sure I agree with you !I think despite there is 1024 value possible, in the calculation you must use 1023.
The comments don't help me understand.
As I said, I don't know how to "read" :
"ADCSRA |= _BV(ADSC);"
I think this kind of expression is closer to C that to Arduino programming !
That is the problem copying code without understanding it ! It can lead to serious mistake !
pure wisdom , seldom seen
Many thanks for securing and encouraging me in that direction. otherwise, I sometime feel like an alien, wanting understanding every bits !
Arduino is not a PC but an embedded processor, it has no operating system that shields of the low level thingies (HAL)
When you program an Arduino (or similar device) you
are have to program ming much closer to the hardware level than you typically do in an PC environment where every device is e.g. a (more or less) nice .NET Class.
If you take a few days to go through the tutorial section, and study, execute, adapt the sketches there you will see most register and bit-masking thingies is not very very difficult. But it takes several dozen projects to get used to it.
You got it I think. That register and bit-masking stuff that I need. But how to get a start with it. I've been turning around this for a while already. I feel, it's what I need, but can't get things on its way.
I think this "Accurate voltmeter" is extremely important with this Arduino things where we need to deal with lots of analogRead() and analogWrite(). That's basis of sensors accuracy. And with Arduino, what to do with no sensor ?
You catch what I need to be able to read this code. Any advice for a start ?