From 6ca1b896edff34cacda2ed84e24455747262f295 Mon Sep 17 00:00:00 2001 From: Austin Blackstone Date: Tue, 15 Nov 2016 13:53:33 -0600 Subject: [PATCH] fix to AnalogIn - Initial state of test caused errors on boards with large drifts --- TESTS/API/AnalogIn/AnalogIn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TESTS/API/AnalogIn/AnalogIn.cpp b/TESTS/API/AnalogIn/AnalogIn.cpp index 583f4c8..c1718ad 100755 --- a/TESTS/API/AnalogIn/AnalogIn.cpp +++ b/TESTS/API/AnalogIn/AnalogIn.cpp @@ -20,14 +20,14 @@ void AnalogInput_Test() outputs.output(); int x = 0; int y= 0; - outputs = 1; + outputs = 0; float prev_value = 0; for(x = 0; x<5; x++) { // printf("X=%d\n",x); -// printf("outputs=0x%x\nprevValue=%f\nain=%f\n\n",y,prev_value,ain.read()); prev_value = ain.read(); y = (y<<1) + 1; outputs = y; +// printf("outputs=0x%x\nprevValue=%f\nain=%f\n\n",y,prev_value,ain.read()); TEST_ASSERT_MESSAGE(ain.read() > prev_value,"Analog Input did not increment. Check that you have assigned valid pins in mbed_app.json file") } // printf("Finished the Test\n");