User Tools

Site Tools


marvin:lab3

This is an old revision of the document!


Lab rapport 3

Lesson 3

In this lesson we will use the NXT sound sensor to turn the LEGO 9797 car into a sound controlled car.

Test of the Sound Sensor The purpose of this test is to make a simple test of the microfon sensitivity to sound coming from different directions.

SoundSensor s = new SoundSensor(SensorPort.S1);
int soundLevel;
 
LCD.drawString("Level: ", 0, 0);
 
while (! Button.ESCAPE.isPressed()) {		   
    soundLevel = s.readValue();
    LCD.drawInt(soundLevel,3,7,0);
    LCD.refresh();
 
    Thread.sleep(5);
}
marvin/lab3.1221813819.txt.gz · Last modified: 2008/09/19 10:43 by rieper