anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Add voltageRead() and temperatureRead() #813

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On the 328 and more modern, you can read temperature and voltage. These are 
useful for many sensors. There's some simple code in the tinker.it repo for 
using them.  We should add voltageRead() and temperatureRead() functions by 
wrapping these in a quick processor type check.

http://code.google.com/p/tinkerit/wiki/SecretThermometer

http://code.google.com/p/tinkerit/wiki/SecretVoltmeter

Original issue reported on code.google.com by tom.i...@gmail.com on 10 Feb 2012 at 6:07

GoogleCodeExporter commented 9 years ago
Note: to make Peter's voltmeter work on a 2560, change the ADMUX settings to 
the following:

ADMUX = _BV(REFS0) | _BV(MUX4)| _BV(MUX3) | _BV(MUX2) | _BV(MUX1);

Original comment by tom.i...@gmail.com on 10 Feb 2012 at 7:17

GoogleCodeExporter commented 9 years ago
Tested the voltmeter on a Mega1280,Mega2560, Mega328, and Mega168. With one or 
the other of those ADMUX lines, it works great.

Original comment by tom.i...@gmail.com on 10 Feb 2012 at 7:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I think it is worth mentioning that the internal voltage reference is not a 
precision reference.  For example, the new Leonardo board uses a ATmega32U4 
which has an accurate of +/-200mV on the 2.56V reference.

Original comment by mkwi...@gmail.com on 11 Jun 2012 at 7:00