1 / 9

Light, Sound, and Ultrasonic Sensor

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. MMN Lab. Light Sensor. Constructor LightSensor(SensorPort port)

ilya
Télécharger la présentation

Light, Sound, and Ultrasonic Sensor

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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.

More Related