Lab 20/ HW 20
Lab 20 (SD Reader w/ Temp Data): /Write to SD #include <SD.h> #include <Wire.h> int temp_address = 72; long previousMillis = 0; int interval = 1000; volatile long int timemax = 60000; const int button1 = 2; const int button2 = 3; //Set by default for the SD Card Library //MOSI = pin 11 //MISO = pin 12 //SCLK = pin 13 //We always need to set the CS Pin const int CS_PIN = 10; void setup() { Serial.begin(9600); attachInterrupt(digitalPinToInterrupt(button1), increase, RISING); attachInterrupt(digitalPinToInterrupt(button2), decrease, RISING); Wire.begin(); Serial.println("Initializing Card"); //CS pin is an output pinMode(CS_PIN, OUTPUT); if (!SD.begin(CS_PIN)) { Serial.println("Card Failure"); return; } Serial.println("Card Ready"); } void increase() { timemax = timemax + 1000; Serial.print("New Time Interval: "); Serial.println(timemax); } void...