This should be fairly basic, but for some reason I cannot get Motor.A.getTachoCount() to give me anything but 0.
I have tried rotate(x), rotateTo(x, true/false), forward(), backward(). Each of them tried something like sleeping for a while, then printing getTachoCount().
So for example this code:
- Code: Select all
Motor.A.setSpeed(50);
Motor.A.regulateSpeed(true);
Motor.A.resetTachoCount();
Motor.A.forward();
for (int i=0; i<50; i++) {
// SLEEP
try {
Thread.sleep(milisec);
} catch(Exception e) { }
// OUTPUT
LCD.clear();
LCD.drawInt(Motor.A.getTachoCount(), 0, 0);
LCD.refresh();
}
Motor.A.stop();
This code and other variations of it with the methods I mentioned above keeps outputting 0. And rotate() and rotateTo() just never stops unless I use really small values like 1..3.
Anyone have suggestions? There is navigator/pilot but in this example I really need to control just one motor and I just can't.
