Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define NEAR 15 //cm
- task main(){
- SetSensorLowspeed(IN_3);
- while(true){
- long startTick = CurrentTick();
- int distance = SensorUS(IN_3);
- long endTick = CurrentTick();
- ClearScreen();
- TextOut(0, 0, "distance: " + NumToStr(distance));
- TextOut(0, 16, "time: " + NumToStr(endTick - startTick));
- Wait(400);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement