From f18378d5dcb4f6c1b3c754b5238c37b505cb7285 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 11 Jun 2012 12:44:35 +0200 Subject: [PATCH] analogRead(..) resolution reverted to 10 bits, waiting for an API extension to be decided --- hardware/arduino/sam/cores/arduino/wiring_analog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/arduino/sam/cores/arduino/wiring_analog.c b/hardware/arduino/sam/cores/arduino/wiring_analog.c index 139e8ddf5..3d5c0ce70 100644 --- a/hardware/arduino/sam/cores/arduino/wiring_analog.c +++ b/hardware/arduino/sam/cores/arduino/wiring_analog.c @@ -91,7 +91,7 @@ uint32_t analogRead(uint32_t ulPin) ; // Read the value - ulValue = adc12b_get_latest_value(ADC12B); + ulValue = adc12b_get_latest_value(ADC12B) >> 2; // Stop the ADC12B // adc12_stop( ADC12B ) ; // never do adc12_stop() else we have to reconfigure the ADC12B each time @@ -135,7 +135,7 @@ uint32_t analogRead(uint32_t ulPin) ; // Read the value - ulValue = adc_get_latest_value(ADC); + ulValue = adc_get_latest_value(ADC) >> 2; // Disable the corresponding channel adc_disable_channel(ADC, ulChannel);