Hi,
I was playing a little bit with MonoBrick, and I noticed that when I use this method:
void MonoBrickFirmware.Movement.Vehicle.Forward ( sbyte speed )
The motors start running, but the method never returns, so you end up blocked in that call.
Is that the expected behavior? I would have thought that the idea of the method was to left the motors running at the given speed and return, to do for example, something like this:
var sensor = new EV3IRSensor(SensorPort.In4);
Vehicle vehicle = new Vehicle (MotorPort.OutB, MotorPort.OutC);
vehicle.ReverseLeft = false;
vehicle.ReverseRight = false;
vehicle.Forward (50);
while (true)
{
if (sensor.ReadDistance () < 40)
{
vehicle.Brake ();
vehicle.Off ();
break;
}
}
Thanks 🙂
Daniel.
Follow