Program Multiple Sensors on Arduino Mega II


I am new on this concept of Arduino. As part of a project I need make an atmospheric and vehicle data acquisition using the followings components: Arduino Mega Barometric Sensor (BME280) Light Sensor (TSL2561) GPS Accelerometer ADXL377 Micro SD

How I can merge all codes of the sensors in only one program? Also, How I can transfer the information to a excel or csv document? Last, How I can configure the MicroSD to store on-board the information?

Thanks! :(

My NeoGPS library has several examples, including an advanced example for saving GPS information on an SD card, in a CSV format. NeoGPS is available from the Arduino IDE Library Manager, under the menu SKetch -> Include Library -> Manage Libraries. Follow the Installation Instructions and start with the simpler examples.

The examples are structured to allow you to add more tasks. In your case, you would periodically read the other 3 sensors (Baro, Accelerometer and Light) and save their readings with fields from the GPS fix structure.

Look at the Blink Without Delay or Multiple Things examples on the Useful Links page at the top of this subforum. It will help you to understand the examples and how to perform a periodic task without using delay. Blocking with delay will cause lots of problems.

Regarding the transfer, you can put the SD card in your PC and copy the files that were written by the Arduino. Or you could print the information to Serial and save it with a "terminal emulator" program (an alternative to the Serial Monitor window).

Cheers, /dev