Really basic question but I couldn't find this in the sensor guide. How do you access the rotation sensor values i.e. to get the distance travelled by the motor. Any help much appreciated. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Really basic question but I couldn't find this in the sensor guide. How do you access the rotation sensor values i.e. to get the distance travelled by the motor. Any help much appreciated. Thanks.
hi,
this is an example to read out the angle of a motor.
PORT=0;// set port which you wants to read out
c = NXT::Motor::GetRotationCount(&comm,PORT);
cout<<"Port" << PORT <<"=" <<c <<"angle"<<"\n";