[chronojump/michrolab] Added surname for the person



commit e3b86c16b2d545bbc54b8286b4ccd7e06d87a680
Author: xpadulles <x padulles gmail com>
Date:   Thu May 26 12:33:31 2022 +0200

    Added surname for the person

 arduino/michrolab/michrolab.ino | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/arduino/michrolab/michrolab.ino b/arduino/michrolab/michrolab.ino
index ff58b07ab..884d1913a 100644
--- a/arduino/michrolab/michrolab.ino
+++ b/arduino/michrolab/michrolab.ino
@@ -268,6 +268,7 @@ String fileName = "";
 struct personType {
   unsigned int index;
   String name;
+  String surname;
   float weight;
   float heigh;
 };
@@ -1634,7 +1635,7 @@ void updatePersonSet()
   tft.setCursor(148, 207);
   tft.print(personSet);
   tft.setCursor(148, 223);
-  tft.print(persons[currentPerson].name);
+  tft.print(persons[currentPerson].name + " " + persons[currentPerson].surname);
   currentPerson = (currentPerson + 1) % totalPersons;
 
   personSet = "Person: " + addLeadingZeros(currentPerson, 2) + "   Set: " + addLeadingZeros(setNumber, 2);
@@ -1643,7 +1644,7 @@ void updatePersonSet()
   tft.setCursor(148, 207);
   tft.print(personSet);
   tft.setCursor(148, 223);
-  tft.print(persons[currentPerson].name);
+  tft.print(persons[currentPerson].name + " " + persons[currentPerson].surname);
   tft.setTextSize(2);
 }
 
@@ -1723,6 +1724,10 @@ void getPersonsList(struct personType * persons)
         prevComaIndex = nextComaIndex;
         nextComaIndex = row.indexOf(",", prevComaIndex + 1 );
         persons[currentPerson].name = row.substring(prevComaIndex + 1 , nextComaIndex);
+        
+        prevComaIndex = nextComaIndex;
+        nextComaIndex = row.indexOf(",", prevComaIndex + 1 );
+        persons[currentPerson].surname = row.substring(prevComaIndex + 1 , nextComaIndex);
 
         prevComaIndex = nextComaIndex;
         nextComaIndex = row.indexOf(",", prevComaIndex + 1 );


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]