Advertisement
Guest User

ddd

a guest
Apr 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. /**
  2. * Mateusz Sobkowiak
  3. * 209205
  4. * v0.1
  5. */
  6.  
  7. import java.util.Observer;
  8. import java.util.Observable;
  9.  
  10. public class Test implements Observer
  11. {
  12. private CortexM0SysTick TestLicznik;
  13. public Test()
  14. {
  15. TestLicznik = new CortexM0SysTick();
  16. TestLicznik.addObserver(this) ;
  17. wypiszinfo();
  18. }
  19.  
  20. public void update(Observable subject, Object arg)
  21. {
  22. System.out.println("Przerwanie");
  23.  
  24. }
  25.  
  26.  
  27. void wypiszinfo()
  28. {
  29. System.out.printf("Okno testowe SysTick %n%n");
  30.  
  31. System.out.printf("Stan startowy -->%n" + TestLicznik);
  32.  
  33. System.out.printf("%n%n1 impuls -->%n" + TestLicznik);
  34. TestLicznik.setEnableFlag(true);
  35. TestLicznik.DajImpuls();
  36.  
  37. System.out.printf("%n%n2 impuls -->%n" + TestLicznik);
  38. TestLicznik.DajImpuls();
  39.  
  40. System.out.println("stan po 3 impulsie ->" + TestLicznik);
  41. TestLicznik.DajImpuls();
  42.  
  43. System.out.println("stan po 4 impulsie ->" + TestLicznik);
  44. TestLicznik.DajImpuls();
  45.  
  46. System.out.println("stan po 5 impulsie ->" + TestLicznik);
  47. TestLicznik.DajImpuls();
  48.  
  49. System.out.println("stan po 6 impulsie ->" + TestLicznik);
  50. }
  51. public static void main (String[] arg)
  52. {
  53. new Test();
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement