Botsingdetectie.java 479 B

12345678910111213141516171819202122232425262728
  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. if(IrDetectL || IrDetectR){
  15. return true;
  16. }else{
  17. return false;
  18. }
  19. }
  20. }