package frc.robot.commands.subsystemState;
import edu.wpi.first.wpilibj.AnalogInput;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystens.Conveyor;
public class Infra extends CommandBase {
Conveyor m_conveyor;
public AnalogInput sharp;
//Constuct a new instance
sharp = new AnalogInput(port);
//Create an accessor method
public double getDistance()
{
double irValue = sharp.getValue();
return (Math.pow(sharp.getAverageVoltage(), -1.2045)) * 27.726;
}
boolean isObjectInIntake = (sharp < 4);
public void startConveyor (boolean a) {
this.isObjectInIntake = a;
if (a == true){
new startConveyor(m_conveyor);
} else {
new stopConveyor(m_conveyor);
}
}
}
I was trying to program the distance sensor Infrared Proximity Sensor - Sharp GP2Y0A21YK. On line 13
But my code is giving me this error, can anyone help?
Thanks in advance