Problem with code!

I don’t understand why the output is showing an error. Here is the error, I have attached images to the code below:

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/988483149/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/988483149/pinned -libraries /tmp/988483149/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=false /tmp/988483149/V2HighAltitudeBalloonDataLogger

Multiple libraries were found for “SoftwareSerial.h”

Used: /home/admin/builder/opt/cores/arduino/avr/libraries/SoftwareSerial

Not used: /home/admin/builder/opt/libraries/latest/printoo_library-1-0-2

Multiple libraries were found for “AltSoftSerial.h”

Used: /home/admin/builder/opt/libraries/latest/altsoftserial-1-4-0

Not used: /home/admin/builder/opt/libraries/latest/cmmc_nb-iot-0-0-2

Not used: /home/admin/builder/opt/libraries/latest/barebonesim800-1-1-0

Not used: /home/admin/builder/opt/libraries/latest/ais_nb_bc95-1-0-4

/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function ‘void sendUBX(uint8_t*, uint8_t)’:

/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:82:5: error: ‘gps_port’ was not declared in this scope

gps_port.write(MSG*);*
^
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:85:3: error: ‘gps_port’ was not declared in this scope
gps_port.println();
^
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function ‘boolean getUBX_ACK(uint8_t*)’:
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:129:9: error: ‘gps_port’ was not declared in this scope
if (gps_port.available()) {
^
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function ‘void GPSloop()’:
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:257:25: error: ‘gps_port’ was not declared in this scope
while (gps.available( gps_port ))
^
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function ‘void setup()’:
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:271:3: error: ‘gps_port’ was not declared in this scope
gps_port.begin(9600);
^
/tmp/988483149/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:292:167: error: expected ‘)’ before ‘USING_GPS_PORT’
Serial.println( F("Looking for GPS device on " USING_GPS_PORT) );
^
exit status 1









Speculsion:
I don’t understand why the output is showing an error. Here is the error, I have attached images to the code below:

Your post is a complete mess, I started to lose the will to live.

Simply post your code between code tags using the </> in the message editor or from the IDE, Edit/Copy for forum and paste it into your message

Yours,
TonyWilk

TonyWilk: ...or from the IDE, Edit/Copy for forum and paste it into your message

I learned something new today. Thanks!

If you have badly screwed up the configuration of your libraries. One way to go is to delete the IDE, re-install, and only install the libraries you specifically need.

But … all the errors here are saying the same thing. The code references something called ‘gps_port’ , and that is not defined anywhere. Well: it needs to be. One possibility is that there is a .h file that you are not including. And a possibility there is that it is defined in a .h file that is part of the sketch, but you are using angle-brackets to include it.

I am most certainly not going to look at screen shots of code. Put the .ino between code tags to quote it. If it’s too big, attach it. If there are lots of files, use github. But if there are lots of files, your project may be more complex than someone at your current skill level can handle.

dougp: I learned something new today. Thanks!

That functionality used to be so screwed up that nobody used it, but it seems to have been fixed somewhere along the line.

I am using my Arduino as a flight computer for my HAB as a part of a school project but I can't get this code to work and also can't figure out what wrong! Here is the code since there is a character limit:

https://gist.github.com/Speculsion/6ec0c0c52696c48c2129e76fad1bf8b7

Here is the error:

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/348085143/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/348085143/pinned -libraries /tmp/348085143/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=false /tmp/348085143/V2HighAltitudeBalloonDataLogger

Multiple libraries were found for "SoftwareSerial.h"

Used: /home/admin/builder/opt/cores/arduino/avr/libraries/SoftwareSerial

Not used: /home/admin/builder/opt/libraries/latest/printoo_library-1-0-2

Multiple libraries were found for "AltSoftSerial.h"

Used: /home/admin/builder/opt/libraries/latest/altsoftserial-1-4-0

Not used: /home/admin/builder/opt/libraries/latest/cmmc_nb-iot-0-0-2

Not used: /home/admin/builder/opt/libraries/latest/barebonesim800-1-1-0

Not used: /home/admin/builder/opt/libraries/latest/ais_nb_bc95-1-0-4

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function 'void sendUBX(uint8_t*, uint8_t)':

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:82:5: error: 'gps_port' was not declared in this scope

gps_port.write(MSG[i]);

^

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:85:3: error: 'gps_port' was not declared in this scope

gps_port.println();

^

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function 'boolean getUBX_ACK(uint8_t*)':

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:129:9: error: 'gps_port' was not declared in this scope

if (gps_port.available()) {

^

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function 'void GPSloop()':

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:257:25: error: 'gps_port' was not declared in this scope

while (gps.available( gps_port ))

^

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino: In function 'void setup()':

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:271:3: error: 'gps_port' was not declared in this scope

gps_port.begin(9600);

^

/tmp/348085143/V2HighAltitudeBalloonDataLogger/V2HighAltitudeBalloonDataLogger.ino:292:167: error: expected ')' before 'USING_GPS_PORT'

Serial.println( F("Looking for GPS device on " USING_GPS_PORT) );

^

exit status 1

Help would be deeply appreciated since this is for a timed assignment and I am seriously having trouble.

clean up the libraries that are installed on your machine would be a good first step may be - and ensure you have the right ones

I got the code from this link but the writer isn't responding to me. Here is the link i got the code from. You need to scroll to the programming section:

https://www.instructables.com/id/The-Easiest-Arduino-High-Altitude-Balloon-Data-Log/

(deleted)

Moderator merged topics.

in the code there is this

  // Only one serial port is available, uncomment one of the following:
  //#include <NeoICSerial.h>
  //#include <AltSoftSerial.h>
 // #include <NeoSWSerial.h>
  #include <SoftwareSerial.h> // I used software serial

did you do weird stuff and uncomment everything? (since the compiler seems to complain about both SoftwareSerial.h and AltSoftSerial.h…)

are you understanding anything at all about the code?

The world is doomed if this is the caliber of students being produced.

Version 2.0 will work to 150,000 feet. Version 2.0 also blinks an LED when data is recorded to the microSD card.

Useful feature, if you are tall enough to see that happening. Tough getting pants for a 40,000 foot plus inseam, though.