*/
public class Photogate extends AnalogInput {
- private double threshold;
+ private double threshold = 1.8;
/***
* The constructor inputs the channel of the transistor and the threshold
* @return whether the ball is present or not
*/
public boolean isBallPresent() {
- if (this.getValue() > threshold)
+ if (this.getVoltage() > threshold)
return true;
else
return false;