Thermistor sketch compile 'EXTERNAL' was not declared

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PL_aus
 
Posts: 5
Joined: Sat Sep 03, 2022 2:42 am

Thermistor sketch compile 'EXTERNAL' was not declared

Post by PL_aus »

Hi,
I am trying to use the Adafruit sketch written for the 10K Precision Epoxy Thermistor - 3950 NTC on the Arduino Uno - from: https://learn.adafruit.com/thermistor?view=all

I am attempting to use it on a Arduino Nano RP2040 Connect. (I've already successfully used more elementary skecthes on this board, with this 10K thermistor. They compile & read values without error.)

I copy and paste into a new sketch the code shown just after "This sketch takes those two improvements and integrates them into the demo, you will have better, more precise readings." on the respective Adafruit web page. When I compile it I get the error message " 'EXTERNAL' was not declared in this scope", with the line "analogReference(EXTERNAL);" highlighted.

I am completely new to programming, so I haven't a clue as to what's wrong. Any suggestions?

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: Thermistor sketch compile 'EXTERNAL' was not declared

Post by adafruit_support_bill »

The advanced sketch uses an external source for the analog reference voltage. It looks like Arduino does not support that for the Nano RP2040 at this time:
https://www.arduino.cc/reference/en/lan ... reference/

User avatar
PL_aus
 
Posts: 5
Joined: Sat Sep 03, 2022 2:42 am

Re: Thermistor sketch compile 'EXTERNAL' was not declared

Post by PL_aus »

Thanks for the quick reply.
Can you suggest another approach to achieve improved accuracy?

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: Thermistor sketch compile 'EXTERNAL' was not declared

Post by adafruit_support_bill »

The Arduino site says that the reference voltage is fixed:
Nano RP2040 Connect has eight analog input pins A0 to A7 and a fixed analog reference voltage of +3.3V. It has a 12-bit ADC on a fixed set of pins A4 to A7. As a result, standard Arduino calls can be used to read their values with a resolution that can go from 0 to 4095, corresponding to the ADC reading of the specific pin.
However, you could use one of the 12-bit pins. That would give you 2 more bits (4x resolution) compared to the standard 10-bit Arduino resolution.

User avatar
PL_aus
 
Posts: 5
Joined: Sat Sep 03, 2022 2:42 am

Re: Thermistor sketch compile 'EXTERNAL' was not declared

Post by PL_aus »

Thanks heaps.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”