Hello,
Like many others I an new, I am not a programmer and really do not find it easy no matter how much I read.
I really would appreciate some help with a small part of my program.
I am using an Arduino Mega
Currently I have a Geiger connected to Serial2 and am using the following snipped to read from that port:
// Now listen on the second port
while (Serial2.available()) {
char inChar = (char)Serial1.read();
// Tried all manner of things here!
Serial.print(inChar);
logfile.print(inChar);
}
The count data from the Geiger is ASCII and each piece ends with "\r\n".
I have tried many things to remove these hidden characters but the snippet wither crashes, fails to compile because I'm trying to use something like remove or replace which I understand are string operators.
At the moment I am writing Date, Time, Serial1, Serial2
Serial2 contains its own \r\n which I use but I cannot remove those codes from Serial1 which is breaking up my line:
Initializing SD card...
Logging to: LOG00023.CSV
2018/6/12,10:20:22,20
2018/6/12,10:20:23,20
21
2018/6/12,10:20:24,20
21
2018/6/12,10:20:25,19
21
2018/6/12,10:20:26,19
21
So I have:
Date,Time(one second increments), Serial1\r\n
Serail2
Date,Time(one second increments), Serial1 \r\n
Serail2
Date,Time(one second increments), Serial1 \r\n
Serail2
What I need is:
Date, Time(one second increments), Serial1, Serial2
Date, Time(one second increments), Serial1, Serial2
Date, Time(one second increments), Serial1, Serial2
Some pointers or assistance would be most helpful.
Regards
Martin