Skip to content

Commit

Permalink
Fixing issue with harness where hardware calls caused exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Joseph committed Feb 22, 2015
1 parent d550d01 commit 3ffc91b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ public int readValue()
* @return Value as raw normalized (0 to 1023) * @return Value as raw normalized (0 to 1023)
*/ */
public int readNormalizedValue() { public int readNormalizedValue() {
return 1023 - port.readRawValue(); return 1023 - 512;
} }


/** /**
* call this method when the light sensor is reading the low value - used by readValue * call this method when the light sensor is reading the low value - used by readValue
**/ **/
public void calibrateLow() public void calibrateLow()
{ {
_zero = port.readRawValue(); _zero = 0;
} }
/** /**
*call this method whtn the light sensor is reading the high value - used by reaeValue *call this method whtn the light sensor is reading the high value - used by reaeValue
*/ */
public void calibrateHigh() public void calibrateHigh()
{ {
_hundred = port.readRawValue(); _hundred = 1023;
} }
/** /**
* set the normalized value corresponding to readValue() = 0 * set the normalized value corresponding to readValue() = 0
Expand Down

0 comments on commit 3ffc91b

Please sign in to comment.