Hello everyone!
I am working on a projekt. I am new to arduino and i need a little help with the programming.
I want to receive data from a sensor that is connected to an Arduino. I want to syncronize the data to a local time.
So what i did basically is to take the data from the sensor and send it 4 times by masking the data and then i syncronized the data wih the time in order to get a new epoch time.
I used the following code.
#include <SoftwareSerial.h>
#include <SD.h>
#include "SDCommunicationLink.h"
#include <Time.h>
unsigned long epoch = 0;
DuplexCommunicationLink link(4, 3);
void setup()
{
pinMode(3,INPUT);
link.open();
}
void loop()
{
if (digitalRead(1) == HIGH)
{
epoch = nu();
}
send(epoch);
}
unsigned long nu()
{
return epoch + millis();
}
void send (unsigned long t)
{
link.write(t & 0xFF);
link.write((t >> 8)&0xFF);
link.write((t >> 16)&0xFF);
link.write((t >> 32)&0xFF);
}
the problem now is to get the data to an SD-card, how do i send my data to my SD-card. Wha functions can i use in order to send the data.
Thank you in advance!