Hi everyone,
I was doing a project with an Arduino UNO that involves receiving and printing clients names and phone numbers and the time that they have registered. I choose to use data streamer on an excel. The problem is that I can't print all of them on the same row. Here is my code
#include <RTClib.h>
#include <Wire.h>
RTC_DS1307 rtc;
char t[32];
String regular[5][4];
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(1000);
Wire.begin();
rtc.begin();
rtc.adjust(DateTime(F(__DATE__),F(__TIME__)));
}
void loop() {
// put your main code here, to run repeatedly:
Case();
}
void Case(){
if (Serial.available()>0)
switch(Serial.read())
{
case 'r':
Regular();
break;
}
}
void Regular(){
Serial.print("case R");
while (Serial.available()==0){
}
regular[0][1]=Serial.readString();
Serial.print(regular[0][1]);
Serial.print(",");
while (Serial.available()==0){
}
regular[0][2]=Serial.readString();
Serial.print(regular[0][2]);
Serial.print(",");
DateTime now = rtc.now();
sprintf(t, "%02d:%02d:%02d %02d/%02d/%02d", now.hour(), now.minute(), now.second(), now.day(), now.month(), now.year());
delay(500);
Serial.print("Date/Time: ");
Serial.println(t);
}
I would start by using serial monitor instead of datastreamer; that will tell you if your Arduino code behaves as expected. If it behaves as expected you know that the issue is with datastreamer.