I am new to Arduino and am launching a high altitude balloon soon. We are adding a second temperature sensor (there is code for only one in the attached file). I need help on what I need to add/change/duplicate and am especially worried about screwing up the GPS. I have tried to do what I can but have hit a dead end. The file attached is without any changes made to it by me. The only thing I added to mine that I'm sure will work is const int temperaturePin2 = 6; .
Please post the program that represents your best attempt at extending the code in your next Reply. It will be easier to help if we can see how you are thinking of going about the problem.
Also please post links to the datasheets for the temperature sensors.
I don't see any problem duplicating it (with different variable names) for a second sensor.
Separately I don't know why you have temperature code and GPS code in the same function. Using short single purpose functions with meaningful names makes code much easier to develop and debug
And there seems to be a strange sequence of top-level functions that do nothing useful
loop() only calls GPSloop() which only calls doSomeWork()
Why not just have the code from doSomeWork() in loop() ?
If you want this balloon launch to be successful and do something useful, I recommend bringing someone on to your team who already understands Arduino.
That person should make sure that the code will work as expected, before the launch.