Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. package w1o3;
  2.  
  3. import hardware.Hardware;
  4.  
  5. public class Controller extends Thread {
  6. Button b1 = new Button(2);
  7. Button b2 = new Button(3);
  8. Led l = new Led(4);
  9.  
  10. public static void main(String[] args) {
  11. Controller c = new Controller();
  12. c.start();
  13.  
  14. }
  15. public void run(){
  16. Hardware.showBediening();
  17. while(true){
  18. if(b1.isPressed())
  19. l.blinkOn();
  20. if(b2.isPressed())
  21. l.blinkOff();
  22. try {
  23. Thread.sleep(100);
  24. } catch (InterruptedException e) {
  25. // TODO Auto-generated catch block
  26. e.printStackTrace();
  27. }
  28. }
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement