Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task main()
- {
- SetSensorTouch(S1); //This program needs a Touch Sensor in Port 1,
- SetSensorUltrasonic(S2); //an Ultrasonic Sensor in Port 2,
- SetSensorLight(S3); //and a Light Sensor in Port 3.
- SetSensorMode(S1, SENSOR_MODE_BOOL); //Set the Touch Sensor to Boolean Mode.
- SetSensorMode(S2, SENSOR_MODE_RAW); //Set the Ultrasonic Sensor to Raw Mode.
- SetSensorMode(S3, SENSOR_MODE_RAW); //Set the Light Sensor to Raw Mode.
- int touched
- while (ButtonPressed)
- {
- "body"
- }
- }
- //NOTES:
- //To read the Ultrasonic Sensor, use SensorUS(port). The port must be configured as a Lowspeed port
- //before using this function. This returns the ultrasonic sensor distance value (0..255).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement