trying to datalog vernier shield data onto SD

I'm using Sparkfun's vernier shield and analogAutoID sketch, and trying to add the SD card datalog language. The problem is what to add at the Open SD part:

// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
File dataFile = SD.open("datalog.txt", FILE_WRITE);

// if the file is available, write to it:
if (dataFile) {
dataFile.println( );
dataFile.close( );
// print to the serial port too:
Serial.println();
}
// if the file isn't open, pop up an error:
else {
Serial.println("error opening datalog.txt");
}
}

I can't figure out how to get it to compile. When I put "Channel" in the print.ln () and close () I get a "Channel wasn't declared in this scope". It's declared earlier in the sketch, though. The entire sketch I'm working on is attached.

analogAutoID_with_SD_attempt.ino (22.1 KB)

Are you able to get examples from the SD library to work?

The problem with your variable is probably scope but I haven't gone through your ino. If it's too big to post in a code window (made with code tags) then there's more to read than I'm up for just now.

Gotcha. Thanks for moving. A little bit after sending I realized, "oh crap, I put my message in the wrong topic folder."

I'm able to use the SD library/language with basic analog read, so I know the core of it is fine. I'm still pretty inexperienced in programming, so I at least get the idea of something not declared, but like I said in the earlier post, it seems declared already.

I looked at you code and Channel is declared as a passed argument for many functions but not

float Thermistor(int Raw)

So perhaps you should include int Channel to int Raw and pass the value to Thermistor().