Skip to content

Conversation

@timothyparez
Copy link
Contributor

Description

  • Make it so the M5Core2.GetAdcGpio method accepts 35 and 36 as the gpioNumber argument.
  • Make it so the M5Core2.GetAdcGpio method correctly configures the pin function and opens the correct adc channel.

Motivation and Context

How Has This Been Tested?

var adc1 = M5Core2.GetAdcGpio(35);
var adc2 = M5Core2.GetAdcGpio(36);

while(true)
{
    var adc1Value = adc1.ReadValue();
    var adc2Value = adc2.ReadValue();    
}

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

Make it so that `M5Core2.GetAdcGpio` accepts value 35 ,
configures the `pin function` and opens the correct adc channel

Partial Fix #1037

Signed-off-by: Timothy Parez <timothyparez@outlook.com>
Make it so that `M5Core2.GetAdcGpio` accepts value 36 ,
configures the `pin function` and opens the correct adc channel

Partial Fix #1037

Signed-off-by: Timothy Parez <timothyparez@outlook.com>
@nfbot nfbot added the Type: bug Something isn't working label May 12, 2022
Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant! Thanks for fixing it. 👍🏻

@josesimoes josesimoes changed the title Add support for ADC on GPIO35/36 on the M5Core2 Fix ADC on GPIO35/36 on the M5Core2 May 12, 2022
@josesimoes josesimoes merged commit bc8f812 into nanoframework:main May 12, 2022
@nfbot
Copy link
Member

nfbot commented May 12, 2022

@timothyparez thank you again for your contribution! 🙏😄

.NET nanoFramework it's all about community involvement and no contribution is too small.
We would like to invite you to join the project Contributors list.

Please edit it and add an entry with your GitHub user in the appropriate location (names sorted alphabetically):

  <tr>
    <td><img src="https://github.com/timothyparez.png?size=50&" height="50" width="50" ></td>
    <td><a href="https://github.com/timothyparez">Timothy</a></td>
  </tr>

(feel free to adjust your name, if it's not correct)

@timothyparez timothyparez deleted the issue-1037 branch May 12, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot get an intance of AdcChannel on M5Core2

3 participants