Presentation is loading. Please wait.

Presentation is loading. Please wait.

Light, Sound, and Ultrasonic Sensor. Doc leJOS API –http://lejos.sourceforge.net/nxt/nxj/api/index.html leJOS Tutorial –http://lejos.sourceforge.net/nxt/nxj/tutorial/index.htm.

Similar presentations


Presentation on theme: "Light, Sound, and Ultrasonic Sensor. Doc leJOS API –http://lejos.sourceforge.net/nxt/nxj/api/index.html leJOS Tutorial –http://lejos.sourceforge.net/nxt/nxj/tutorial/index.htm."— Presentation transcript:

1 Light, Sound, and Ultrasonic Sensor

2 Doc leJOS API –http://lejos.sourceforge.net/nxt/nxj/api/index.html leJOS Tutorial –http://lejos.sourceforge.net/nxt/nxj/tutorial/index.htm MMN Lab.

3 Light Sensor Constructor –LightSensor(SensorPort port) –LightSensor(SensorPort port, boolean floodlight) ) Method –int readValue() Higher numbers indicate more light –Int readNormalizedValue() MMN Lab.

4 Light Sensor cont’d Sample program MMN Lab.

5 Sound Sensor Constructor –SoundSensor(SensorPort port) –SoundSensor(SensorPort port, boolean dba) Method –int readValue() –Void setDBA(boolean dba) MMN Lab.

6 Sound Sensor cont’d Sample program MMN Lab.

7 Ultrasonic Sensor Constructor –UltrasonicSensor (SensorPort port) Method –int getDistance() MMN Lab.

8 Ultrasonic Sensor cont’d Sample program MMN Lab.

9 Lab4 Scenario –1. Move forward until light sensor detects the black area –2. Use the sound sensor such that the arm will hit the ball away after a indication –3. Start to move and stop before bumping into the wall Hint –For the arm, you can use Motor.PORT.Method to do some action MMN Lab.


Download ppt "Light, Sound, and Ultrasonic Sensor. Doc leJOS API –http://lejos.sourceforge.net/nxt/nxj/api/index.html leJOS Tutorial –http://lejos.sourceforge.net/nxt/nxj/tutorial/index.htm."

Similar presentations


Ads by Google