Skip to content

Commit

Permalink
fix to AnalogIn - Initial state of test caused errors on boards with …
Browse files Browse the repository at this point in the history
…large drifts
  • Loading branch information
BlackstoneEngineering committed Nov 15, 2016
1 parent 53d4476 commit 6ca1b89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TESTS/API/AnalogIn/AnalogIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 6ca1b89

Please sign in to comment.