Botsingdetectie.java 551 B

123456789101112131415161718192021222324252627282930
  1. package boebot;
  2. public class Botsingdetectie{
  3. private IrDetectie irL;
  4. private IrDetectie irR;
  5. private boolean IrDetectL;
  6. private boolean IrDetectR;
  7. public Botsingdetectie(){
  8. irL = new IrDetectie(8, 9);
  9. irR = new IrDetectie(2, 0);
  10. }
  11. public boolean detectEdge(){
  12. IrDetectL = irL.detect();
  13. IrDetectR = irR.detect();
  14. System.out.println(IrDetectL);
  15. System.out.println(IrDetectR);
  16. if(IrDetectL || IrDetectR){
  17. return true;
  18. }else{
  19. return false;
  20. }
  21. }
  22. }