ramsay-t / ShefRobot

Wrapper classes for Java code to use Lego robots.
3 stars 1 forks source link

Motor not connected to robot error? #29

Closed Robadob closed 8 years ago

Robadob commented 8 years ago

Ramsay said this doesn't work.

It appears to be implemented at Motor.java:290, I may have done this under the assumption that it throws the same IllegalArgumentException that a sensor with invalid port throws (I saw this error in someone's console in the lab), so may need testing.

Are you sure it was not that it prints out the explanation that the motor isn't connected right, followed by the stack trace, this may have confused the student?

Robadob commented 8 years ago

Just tested this with a Motor/Touch Sensor/Color Sensor & Gyro Sensor.

It appears the Active devices (Color and Gyro) throw the exception, but passive ones (Motor and Touch) don't. So I'm not sure what the students error would have been.