Selaa lähdekoodia

Coordinate function

Tom Remeeus 11 vuotta sitten
vanhempi
commit
1d5229636c
2 muutettua tiedostoa jossa 13 lisäystä ja 5 poistoa
  1. 6 4
      Aansturing.java
  2. 7 1
      BoeBot.java

+ 6 - 4
Aansturing.java

@@ -9,10 +9,10 @@ public class Aansturing
    private int ex;
    private int ey;
    public String coordinaten;
-   public Aansturing(int maxx, int maxy)
+   public Aansturing()
    {
-       this.maxx = maxx;
-       this.maxy = maxy;
+       maxx = 0;
+       maxy = 0;
        rotation = 0;
        x = 0;
        y = 0;
@@ -144,8 +144,10 @@ public class Aansturing
        }
        return "bestemming bereikt " + geefCoordinaten();
    }
-   public char[] berekenRoute(int eindx, int eindy, int beginx, int beginy, int rotatie)
+   public char[] berekenRoute(int eindx, int eindy, int beginx, int beginy, int rotatie, int maxy1, int maxx1)
    {
+		maxx = maxx1;
+		maxy = maxy1;
        char[] route = new char[40];
        int teller = 0;
        int links = 0;

+ 7 - 1
BoeBot.java

@@ -37,7 +37,13 @@ public class BoeBot{
                 int btcode = 0;
                 while(true){
                         btcode = bluetooth.checkBt();
-                        if(btcode == 2){
+						if (btcode == 3)
+						{
+							System.out.println("Coördinaten ontvangen!");
+							bluetooth.filterData();
+						}
+							
+                        else if(btcode == 2){
                           System.out.println("Route ontvangen!");
                           route = bluetooth.getRoute();
                           routeAfgerond = true;