Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[esomx] map ADC channels to the correct pins #2495

Merged
merged 1 commit into from
Jul 27, 2022
Merged

Conversation

technobly
Copy link
Member

@technobly technobly commented Jul 27, 2022

NOTE: This PR should also be backported to 4.x

Problem

ESoMX ADC pins were mapped incorrectly, which caused analogRead(A0~A7) to fail.

Solution

Remap the ADC channel/pins per Boron/BSoM mapping.

Steps to Test

  • Run the example app below and look for correct behavior with a 10k potentiometer connected to 3.3V and GND, wiper on the pin under test. Set the pot to about halfway. This should be about 5k ohms of impedance and give a stable reading. Walk the connection between A0 - A7 as the test advances. The reading should be stable.
  • Run TEST=wiring/no_fixture and GPIO_08_DigitalReadWorksMixedWithAnalogRead should pass.

Example App

#include "Particle.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
Serial1LogHandler log1Handler(115200, LOG_LEVEL_ALL);
SerialLogHandler logHandler(LOG_LEVEL_ALL);

void setup() {
    for (int i = 10; i < 18; i++) {
        for (int x = 0; x < 10; x++) {
            Log.info("Reading (A%d): %ld", i-10, analogRead(i));
            delay(1000);
        }
    }
}
void loop() {
}

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@technobly technobly added the bug label Jul 27, 2022
@technobly technobly added this to the 5.0.0 milestone Jul 27, 2022
@technobly technobly merged commit 58d3368 into develop Jul 27, 2022
@technobly technobly deleted the fix/esomx-adc branch July 27, 2022 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants