I have been having problems with making a program that consistently runs . I am beginner to arduino. Here is the following code: ANY ADICE OR HELP IS MUCH APPRECIATED
include<SPI.h> //Load SPI Library
#include <Adafruit_BMP183.h>
#include <Adafruit_Sensor.h>
#define BMP183_CLK 9
#define BMP183_SDO 8 // AKA MISO
#define BMP183_SDI 7 // AKA MOSI
#define BMP183_CS 6
Adafruit_BMP183 bmp = Adafruit_BMP183(BMP183_CLK, BMP183_SDO, BMP183_SDI, BMP183_CS);
int chipSelect = 10; //chipSelect pin for the SD card Reader
File mySensorData; //Data object you will write your sesnor data to
void setup(){
bmp.begin();
pinMode(10, OUTPUT); //Must declare 10 an output and reserve it
SD.begin(10); //Initialize the SD card reader
}
void loop() {
mySensorData = SD.open(“TrialA500.txt”, FILE_WRITE);
float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA; // should be ~1000
delay(100); //Pause between readings.
mySensorData.println(bmp.getAltitude(seaLevelPressure)); //write pressure and end the line (println)
mySensorData.close(); //close the file
}