From f09a9e885615c5250cf3b323af77e10ca3edc584 Mon Sep 17 00:00:00 2001 From: Ubi de Feo Date: Tue, 20 Oct 2020 11:30:29 +0200 Subject: [PATCH 1/5] Include Nano 33 and Portenta These boards are lacking in this piece of documentation, possibly elsewhere --- .../Zero, Due, MKR Family/analogReadResolution.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc index 8dbf51d92..2da3e80c2 100644 --- a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc +++ b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc @@ -1,7 +1,7 @@ --- title: analogReadResolution() categories: [ "Functions" ] -subCategories: [ "Zero, Due & MKR Family" ] +subCategories: [ "Zero, Due, MKR family, Nano 33 (BLE and IoT) and Portenta" ] --- @@ -16,11 +16,12 @@ subCategories: [ "Zero, Due & MKR Family" ] [float] === Description -analogReadResolution() is an extension of the Analog API for the Arduino Due, Zero and MKR Family. +analogReadResolution() is an extension of the Analog API for the Zero, Due, MKR family, Nano 33 (BLE and IoT) and Portenta. Sets the size (in bits) of the value returned by `analogRead()`. It defaults to 10 bits (returns values between 0-1023) for backward compatibility with AVR based boards. -The *Due, Zero and MKR Family* boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12. This will return values from `analogRead()` between 0 and 4095. +The *Zero, Due, MKR family and Nano 33 (BLE and IoT)* boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12. This will return values from `analogRead()` between 0 and 4095. +The Portenta H7 has a 16 bit ADC, which will allow values between 0 and 65535. [%hardbreaks] @@ -31,7 +32,7 @@ The *Due, Zero and MKR Family* boards have 12-bit ADC capabilities that can be a [float] === Parameters -`bits`: determines the resolution (in bits) of the value returned by the `analogRead()` function. You can set this between 1 and 32. You can set resolutions higher than 12 but values returned by `analogRead()` will suffer approximation. See the note below for details. +`bits`: determines the resolution (in bits) of the value returned by the `analogRead()` function. You can set this between 1 and 32. You can set resolutions higher than the supported 10,12 or 16 bits, but values returned by `analogRead()` will suffer approximation. See the note below for details. [float] From faf193dfb90870a3149fb08eb78e806227f07924 Mon Sep 17 00:00:00 2001 From: Ubi de Feo Date: Wed, 21 Oct 2020 07:24:51 +0200 Subject: [PATCH 2/5] Update Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc Co-authored-by: per1234 --- .../Functions/Zero, Due, MKR Family/analogReadResolution.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc index 2da3e80c2..cc03e9292 100644 --- a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc +++ b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc @@ -20,8 +20,8 @@ analogReadResolution() is an extension of the Analog API for the Zero, Due, MKR Sets the size (in bits) of the value returned by `analogRead()`. It defaults to 10 bits (returns values between 0-1023) for backward compatibility with AVR based boards. -The *Zero, Due, MKR family and Nano 33 (BLE and IoT)* boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12. This will return values from `analogRead()` between 0 and 4095. -The Portenta H7 has a 16 bit ADC, which will allow values between 0 and 65535. +The *Zero, Due, MKR family and Nano 33 (BLE and IoT)* boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12. This will return values from `analogRead()` between 0 and 4095. + +The *Portenta H7* has a 16 bit ADC, which will allow values between 0 and 65535. [%hardbreaks] From 563a8a2f61b9e87b90026d0acdfc17505d6a5fc4 Mon Sep 17 00:00:00 2001 From: Ubi de Feo Date: Wed, 21 Oct 2020 07:28:37 +0200 Subject: [PATCH 3/5] Update Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc Yes! I just discovered that such method is not available and throws an error. I believe it should be added to cores which do not support multiple resolutions, just in case a user obtains a sketch made on an *arm* board and the compilation error makes no sense to them. The method could be just a sinkhole but would prevent the compile error :) Co-authored-by: per1234 --- .../Functions/Zero, Due, MKR Family/analogReadResolution.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc index cc03e9292..d24200aa1 100644 --- a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc +++ b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc @@ -32,7 +32,7 @@ The *Portenta H7* has a 16 bit ADC, which will allow values between 0 and 65535. [float] === Parameters -`bits`: determines the resolution (in bits) of the value returned by the `analogRead()` function. You can set this between 1 and 32. You can set resolutions higher than the supported 10,12 or 16 bits, but values returned by `analogRead()` will suffer approximation. See the note below for details. +`bits`: determines the resolution (in bits) of the value returned by the `analogRead()` function. You can set this between 1 and 32. You can set resolutions higher than the supported 12 or 16 bits, but values returned by `analogRead()` will suffer approximation. See the note below for details. [float] From b81910aa3dc86a96b85f0a3c0623a8ba83cc7978 Mon Sep 17 00:00:00 2001 From: Ubi de Feo Date: Wed, 21 Oct 2020 07:54:09 +0200 Subject: [PATCH 4/5] changed subcategory to "Analog I/O" --- .../Functions/Zero, Due, MKR Family/analogReadResolution.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc index d24200aa1..8a935374e 100644 --- a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc +++ b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc @@ -1,7 +1,7 @@ --- title: analogReadResolution() categories: [ "Functions" ] -subCategories: [ "Zero, Due, MKR family, Nano 33 (BLE and IoT) and Portenta" ] +subCategories: [ "Analog I/O" ] --- From 1364733077fff79d5e59d2432d7c55eb516185ec Mon Sep 17 00:00:00 2001 From: Ubi de Feo Date: Wed, 21 Oct 2020 08:06:34 +0200 Subject: [PATCH 5/5] Sub-category changed back to "Zero, Due & MKR Family" In order to submit a new PR with just the category change --- .../Functions/Zero, Due, MKR Family/analogReadResolution.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc index 8a935374e..4531306b3 100644 --- a/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc +++ b/Language/Functions/Zero, Due, MKR Family/analogReadResolution.adoc @@ -1,7 +1,7 @@ --- title: analogReadResolution() categories: [ "Functions" ] -subCategories: [ "Analog I/O" ] +subCategories: [ "Zero, Due & MKR Family" ] ---