Henrique Cardoso / Mbed OS Lidar_Rodas

Dependencies:   BufferedSerial

Revision:
7:f1c122bc63c8
Parent:
6:59fbbeaac2af
Child:
8:ad8766cf2ec0
diff -r 59fbbeaac2af -r f1c122bc63c8 Functions.cpp
--- a/Functions.cpp	Fri May 07 17:19:07 2021 +0000
+++ b/Functions.cpp	Mon May 10 15:23:24 2021 +0000
@@ -59,17 +59,18 @@
     
 }
 
-//void bresenham(float poseX, float poseY, float x1, float y1, float MapaLog[][40], float z){
-void cona(float poseX, float poseY, float x1, float y1, float z){
+void bresenham(int poseX, int poseY, int xf, int yf, float (&MapaLog)[40][40], float z){
+//void cona(float poseX, float poseY, float x1, float y1, float z){
+    printf("bresenham!\n\r");
     /*
     int T, E, A, B;
-    int x = static_cast<int>(poseX);
-    int y = static_cast<int>(poseY);
-    int dx = static_cast<int>(abs(x1 - poseX));
-    int dy = static_cast<int>(abs(y1 - poseY));
+    int x = poseX;
+    int y = poseY;
+    int dx = abs(xf - poseX);
+    int dy = abs(yf - poseY);
     
-    int s1 = static_cast<int>((x1 - poseX)/dx); // substitui o sign() do matlab
-    int s2 = static_cast<int>((y1 - poseY)/dy);
+    int s1 = (xf - poseX)/dx; // substitui o sign() do matlab
+    int s2 = (yf - poseY)/dy;
     
     int interchange = 0;