-
Notifications
You must be signed in to change notification settings - Fork 36
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
AnalogIn test correction #7
Conversation
@bcostm Wouldnt the simpler fix be just to initialize outputs and y to 1? |
@BlackstoneEngineering I think the algorithm is done in the wrong order, it should be:
it doesn't makes sense to assert that something is different if nothing has changed yet. for(x = 0; x<5; x++) {
prev_value = ain.read();
y = (y<<1) + 1;
outputs = y;
TEST_ASSERT_MESSAGE(ain.read() > prev_value,"Analog Input did not incriment. Check that you have assigned valid pins in mbed_app.json file")
} |
Hi, |
I will close the issue and update directly to master, i've already got a couple patches pending, I'll toss in this one line change. Thanks all for the input and helping us build a better ecosystem! |
@BlackstoneEngineering Whats the status of this PR? Can it be closed? |
@0xc0170 yeah, the changes have been mainlined already |
Change initial value of prev_value + do only one adc read.
Correction of Issue ARMmbed/mbed-os#2956