#if defined(__AVR__)
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = READVCC_CALIBRATION_CONST / result; //1100mV*1024 ADC steps http://openenergymonitor.org/emon/node/1186
return result;
#elif defined(__arm__)
return (3300); //Arduino Due
#else
return (3300); //Guess that other un-supported architectures will be running a 3.3V!
#endif
}
three cases: for AVR, arm and other processor types.
@mel
Is __arm__ set for you? Print it and see. In setup for your sketch, put
#ifdef(__arm__) Serial.println("__arm__ is defined"); #endif
If it says it is, then you should be OK. If not, then the safest solution for you, unless you can find something set by your choice of board in the IDE, is what I wrote in post 18 above.