Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. task main()
  2. {
  3. SetSensorTouch(S1);                   //This program needs a Touch Sensor in Port 1,
  4. SetSensorUltrasonic(S2);              //an Ultrasonic Sensor in Port 2,
  5. SetSensorLight(S3);                   //and a Light Sensor in Port 3.
  6. SetSensorMode(S1, SENSOR_MODE_BOOL);  //Set the Touch Sensor to Boolean Mode.
  7. SetSensorMode(S2, SENSOR_MODE_RAW);   //Set the Ultrasonic Sensor to Raw Mode.
  8. SetSensorMode(S3, SENSOR_MODE_RAW);   //Set the Light Sensor to Raw Mode.
  9. int touched
  10.  
  11. while (ButtonPressed)
  12.  
  13.   {
  14.   "body"
  15.   }
  16. }
  17. //NOTES:
  18.  
  19. //To read the Ultrasonic Sensor, use SensorUS(port). The port must be configured as a Lowspeed port
  20. //before using this function. This returns the ultrasonic sensor distance value (0..255).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement