Sorry if this is in the wrong location (having trouble searching for the right place).
I have my code reading and dividing it up with out a problem, with the exception that I would like to read (for lack of better terms) the info and skip the comments.
Is there a way to cause the StreamReader to go to the next line, regardless of whether or not there is anything remaining on the current line.
Here is sample of my file:
TRUE; //Enable AC Power Supply #1 Monitoring
FALSE; //Enable AC Power Supply #2 Monitoring
TRUE; //Enable Forward Combustible Fume Detection
I want the true and ignore the semi-colon and comments. Here is what I have reads it all:
#include <SD.h>
#include <SPI.h>
String val;
void setup() {
Serial.begin(9600); // Start Serial for Debugging
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
if(!SD.begin(4)) Serial.println("SD fail");
else Serial.println("SD ok");
File cfg = SD.open("cfg.ini", FILE_READ);
int i = 0;
while (cfg.available()) {
val = cfg.readStringUntil(';');
Serial.println(i);
Serial.println(val); //Printing for debugging purpose
i++;
//move val to my parameters
}
cfg.close();
}
void loop() {
// put your main code here, to run repeatedly:
}
Here is the current output, obviously the first one is perfect but the balance is off.
SD ok
0
TRUE
1
//Enable AC Power Supply #1 Monitoring
FALSE
2
//Enable AC Power Supply #2 Monitoring
TRUE
Any assistance is much appreciated!!