How is the bandgap, in relation to the temp sensor, being measured?
How can I read it for all three sensors?
Relevant bits of code:
- Code: Select all
// The analog pins that connect to the sensors
#define tempPinRef 0 // analog 0
#define tempPin1 1 // analog 1
#define tempPin2 2 // analog 2
#define BANDGAPREF 14 // special indicator that we want to measure the bandgap
#define aref_voltage 3.3 // we tie 3.3V to ARef and measure it with a multimeter!
#define bandgap_voltage 1.1 // this is not super guaranteed but its not -too- off
// Log the estimated 'VCC' voltage by measuring the internal 1.1v ref
int refReading = analogRead(BANDGAPREF);
return supplyvoltage = (bandgap_voltage * 1024) / refReading;
Thanks for looking.