Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BufferedSerial
Diff: Functions.cpp
- Revision:
- 7:f1c122bc63c8
- Parent:
- 6:59fbbeaac2af
- Child:
- 8:ad8766cf2ec0
--- 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;