Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LEGO Group 8
LEGO
Commits
663a1d6b
Commit
663a1d6b
authored
Mar 03, 2015
by
Peder Kronsgaard Detlefsen
Browse files
Added SoundSensorTest from exercise 1.
parent
bb5ca761
Changes
1
Hide whitespace changes
Inline
Side-by-side
lesson3/SoundSensorTest/src/SoundSensorTest.java
0 → 100644
View file @
663a1d6b
import
lejos.nxt.*
;
/**
* A simple sound sensor test program.
*/
public
class
SoundSensorTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SoundSensor
ss
=
new
SoundSensor
(
SensorPort
.
S2
);
LCD
.
drawString
(
"Sound "
,
0
,
0
);
LCD
.
drawString
(
"Sound lvl "
,
0
,
2
);
while
(!
Button
.
ESCAPE
.
isDown
())
{
LCD
.
drawInt
(
ss
.
readValue
(),
3
,
13
,
2
);
}
LCD
.
clear
();
LCD
.
drawString
(
"Program stopped"
,
0
,
0
);
Thread
.
sleep
(
2000
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment