RE: ATTiny45 AREF

Hi OldSteve

Sorry to take so long to get back to you. I had a chance to sit down this evening and test whether a simple sketch would compile using analogReference(INTERNAL2V56).

void setup() {
  analogReference(INTERNAL2V56);
}

void loop() {

}

Unfortunately I get the following error.

exit status 1
'INTERNAL2V56' was not declared in this scope

If I however change the sketch.

void setup() {
  analogReference(INTERNAL);
}

void loop() {

}

My code compiles. 2.56V is my preference reference. :wink:

I've done some further searching and found the following thread on the Arduino forum.

analogReference on ATTiny85

If you check out specifically post #6 there is a odd suggestion involving defining a constant. I'm not quite sure what's happening here although if I copy and paste the code it does compile? :confused:

#define INTERNAL2V56_NO_CAP (6)

void setup( void )
{
  analogReference( INTERNAL2V56_NO_CAP );
}

What does the bracketed six represent?

Cheers

Jase :slight_smile:

PS I'm not sure what 'Core' means? I've tried reading up on this and have also spoken to a retired Electrical Engineering lecturer and the best I've come up with is it's the guts of the chip???