Documente Academic
Documente Profesional
Documente Cultură
#include <SD.h>
#include <Wire.h> //llamado de libreria
#include "RTClib.h" //llamado de libreria DS1307
#include<SPI.h>
RTC_DS1307 RTC;
const int chipSelect = 8;
int sensorPin=A0;
long sensorValue;
float temperatura1=0;
int sensorPin2=A1;
long sensorValue2;
float temperatura2=0;
int sensorPin3=A2;
long sensorValue3;
float temperatura3=0;
int sensorPin4=A3;
long sensorValue4;
float temperatura4=0;
int sensorPin5=A4;
long sensorValue5;
float temperatura5=0;
int sensorPin6=A5;
long sensorValue6;
float temperatura6=0;
int sensorPin7=A6;
long sensorValue7;
float temperatura7=0;
int sensorPin8=A7;
long sensorValue8;
float temperatura8=0;
int sensorPin9=A8;
long sensorValue9;
float temperatura9=0;
int sensorPin10=A9;
long sensorValue10;
float temperatura10=0;
int sensorPin11=A10;
long sensorValue11;
float temperatura11=0;
int sensorPin12=A11;
long sensorValue12;
float temperatura12=0;
int sensorPin13=A12;
long sensorValue13;
float temperatura13=0;
int sensorPin14=A13;
long sensorValue14;
float temperatura14=0;
int sensorPin15=A14;
long sensorValue15;
float temperatura15=0;
int sensorPin16=A15;
long sensorValue16;
float temperatura16=0;
void setup() {
Serial.begin(9600);
Wire.begin();
RTC.begin();
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// La siguiente linea de codigo permite escritura de la hora y fecha de la PC
//RTC.adjust(DateTime(__DATE__, __TIME__));
}
Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
// output, even if you don't use it:
pinMode(chipSelect, OUTPUT);
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Serial.println("card initialized.");
//modulo RTC verificar si esta conectado
}
void loop() {
String dataString = "";