Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import lejos.nxt.Button;
- import lejos.nxt.Motor;
- public class first1 {
- public static void main (String[] args) {
- fire();
- }
- public static void fire() //fire marble gun (360 degree rotation on Motor A)
- {
- Button.waitForAnyPress();
- if(Button.ENTER.isDown()) //if enter is pressed, fire
- {
- Motor.A.rotate(360);
- }
- if(!Button.ESCAPE.isDown()) //if escape is pressed, exit program
- {
- fire();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement