Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2023:adarmaz:sistem-cartografiere-sol [2023/05/30 09:09]
ioana.profeanu [Utilizarea cardului SD]
pm:prj2023:adarmaz:sistem-cartografiere-sol [2023/05/30 09:13] (current)
ioana.profeanu [Download cod]
Line 347: Line 347:
 <code cpp> <code cpp>
  
-// function ​for extracting ​the latitude +// function ​which, from an input NMEA sentence, 
-String ​extractLatitude(const String& sentence) {+// extracts a string with the latitude 
 +String ​extractCoordinates(const String& sentence) 
 +{
   int commas;   int commas;
   if (sentence.indexOf("​GPRMC"​) != -1) {   if (sentence.indexOf("​GPRMC"​) != -1) {
Line 362: Line 364:
   int endIndex = -1;   int endIndex = -1;
  
 +  // count commas and extract the value of the latitude
   for (size_t i = 0; i < sentence.length();​ i++) {   for (size_t i = 0; i < sentence.length();​ i++) {
     if (sentence[i] == ','​) {     if (sentence[i] == ','​) {
Line 381: Line 384:
 } }
  
-// function ​for receiving ​NMEA sentences+// function ​which reads NMEA sentences ​from 
 +// software serial for 20 seconds and returns the 
 +// latitude in case the sentence is valid
 String getGPGGAsentence() String getGPGGAsentence()
 { {
Line 390: Line 395:
   gpsSerial.begin(9600);​   gpsSerial.begin(9600);​
  
-  // repeat the reading for 20 seconds 
   while (timerDisplayInfo - currentTime < MINUTE / 4) {   while (timerDisplayInfo - currentTime < MINUTE / 4) {
     if (gpsSerial.available()) {     if (gpsSerial.available()) {
Line 414: Line 418:
   return sentence;   return sentence;
 } }
- 
 </​code>​ </​code>​
 </​spoiler>​ </​spoiler>​
Line 464: Line 467:
 ===== Download cod ===== ===== Download cod =====
  
-Codul poate fi vizualizat [[https://​github.com/​ioanaprofeanu/​Sistem-cartografiere-sol.git|aici]].+Codul poate fi vizualizat [[https://​github.com/​ioanaprofeanu/​Sistem-cartografiere-sol.git|aici]] ​sau descărcat {{:​pm:​prj2023:​adarmaz:​sistem_cartografiere_sol.zip|aici}}.
 ===== Jurnal ===== ===== Jurnal =====
  
pm/prj2023/adarmaz/sistem-cartografiere-sol.1685426964.txt.gz · Last modified: 2023/05/30 09:09 by ioana.profeanu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0