GPS to Pulga

Dependencies:   Si1133 BME280

Files at this revision

API Documentation at this revision

Comitter:
brunnobbco
Date:
Fri Dec 11 18:59:00 2020 +0000
Parent:
25:ecdee9ef9939
Commit message:
Pulga_GPS

Changed in this revision

gps.txt Show annotated file Show diff for this revision Revisions of this file
source/main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ecdee9ef9939 -r 1e1776201716 gps.txt
--- a/gps.txt	Fri Oct 23 14:42:31 2020 +0000
+++ b/gps.txt	Fri Dec 11 18:59:00 2020 +0000
@@ -207,7 +207,7 @@
         }
         else if (state == 2) {// read 0xb5 0x62
             if (spi_2.write(0x00) == 0x01){
-                printf("le_nav_pvt going to state 3");
+                //printf("le_nav_pvt going to state 3");
                 state =3;
                 //wait_ms(30);
             }
@@ -216,7 +216,7 @@
         else if (state == 3) {// read 0xb5 0x62 0x01
             if (spi_2.write(0x00) == 0x07){
                 state =4;
-                printf("le_nav_pvt going to state 4");
+                //printf("le_nav_pvt going to state 4");
                 //wait_ms(30);
             }
             else state =0;
@@ -224,7 +224,7 @@
         else if (state == 4) {// read 0xb5 0x62 0x01 0x07
             if (spi_2.write(0x00) == 0x5c){
                 state =5;
-                printf("le_nav_pvt going to state 5");
+                //printf("le_nav_pvt going to state 5");
                 //wait_ms(30);
             }
             else state =0;
@@ -232,7 +232,7 @@
         else if (state == 5) {// read 0xb5 0x62 0x01 0x07 0x5c
             if (spi_2.write(0x00) == 0x00){
                 state =6;
-                printf("le_nav_pvt going to state 6");
+                //printf("le_nav_pvt going to state 6");
                 //wait_ms(30);
             }
             else state =0;
@@ -279,7 +279,7 @@
             value4 = 0xff & spi_2.write(0x00);                   
             Pac.lon =  (value4 << 24) + (value3 <<16) + (value2 << 8) + value1;
             lon=  (value4 << 24) + (value3 <<16) + (value2 << 8) + value1;
-            printf("Long Data %d \n ", lon);
+            //printf("Long Data %d \n ", lon);
             
             value1 = 0xff & spi_2.write(0x00);
             value2 = 0xff & spi_2.write(0x00);
@@ -287,7 +287,7 @@
             value4 = 0xff & spi_2.write(0x00);                   
             Pac.lat =  (value4 << 24) + (value3 <<16) + (value2 << 8) + value1;
             lat =  (value4 << 24) + (value3 <<16) + (value2 << 8) + value1;
-            printf("Lat Data %d", lat);
+            //printf("Lat Data %d", lat);
             
             
             value1 = 0xff & spi_2.write(0x00);
diff -r ecdee9ef9939 -r 1e1776201716 source/main.cpp
--- a/source/main.cpp	Fri Oct 23 14:42:31 2020 +0000
+++ b/source/main.cpp	Fri Dec 11 18:59:00 2020 +0000
@@ -14,6 +14,7 @@
 int latitude=0;
 int longitude=0;
 DigitalOut led1(P1_13);
+DigitalOut led2(P1_14);
 
 //Includes
 #include "gps.txt"
@@ -31,6 +32,7 @@
      }
 int main() {  
 
+    led2=0;
     gps_config();
     gps_leBootMsg();
     gps_config_gnss ();