Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import lejos.nxt.*;
- public class Program {
- public static void main(String[] args) throws InterruptedException {
- SensorPort.S1.addSensorPortListener(new SensorPortListener(){
- @Override
- public void stateChanged(SensorPort source, int oldValue, int newValue) {
- if(newValue>1000)
- LCD.drawString("Released", 0, 0);
- else
- LCD.drawString("Pressed ", 0, 0);
- }
- });
- Button.waitForAnyPress();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement