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.
Diff: Robot.cpp
- Revision:
- 5:25bd866ef068
- Parent:
- 1:dc87724abce8
- Child:
- 6:df6b8b2468d8
--- a/Robot.cpp Mon May 03 15:22:53 2021 +0000
+++ b/Robot.cpp Mon May 17 15:03:21 2021 +0000
@@ -60,4 +60,22 @@
i2c.read( addr8bit, read_buffer, 4);
countsLeft = (int16_t((read_buffer[0]<<8)|read_buffer[1]));
countsRight = (int16_t((read_buffer[2]<<8)|read_buffer[3]));
-}
\ No newline at end of file
+}
+
+//Funcao para criar um mapa simples com um quadrado no meio
+void read_map(int Map_Matrix[80][80]){
+ for(int i = 0; i < 80; i++){
+ for(int j = 0; j < 80; j++){
+ if(i == 0 || j==0 || i==79 || j==79){
+ Map_Matrix[i][j] = 1;
+ }
+ else{
+ Map_Matrix[i][j] = 0;
+ if(i >= 10 && j>=10 && i<=69 && j<=69){
+ Map_Matrix[i][j] = 1;
+ }
+ }
+ }
+ }
+}
+