I have a very simple program, that reads the distance from the Sonar-sensor. If the distance is above 20 cm, the motors A and B will turn backwards until the distance is above 20 cm.
This works just fine in debugging-mode, but not when the program is targeted to the NXT itself. I think this has to be something about sampletimes? I can add a Wait for 200 ms" and its get bettet. But there must be some kind of documentation about this?
Any thoughts is appriciated.
It should not be nessasary with a wait function.
Could you please check if the following example program works on your device:
Help --> Find examples --> Directory Structure --> NXT Robotics --> Motors --> Case_Structure_Motor_Control.vit
It has approximately the same structure as your application.
National Instruments Denmark
Thank you for your reply.
The example program works just fine. It could seems like the Read Sonar is different than the other Read sensor? I found another guy with the exact same problem: