Trying to output to SDcard

#include “iostream”
#include “vex.h”
#include “fstream”
#include “string”
using namespace vex;
using namespace std;
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
ofstream output(“output.txt”, ofstream::out);
int count1 = 0;
int count2 = 0;
int count3 = 200;
while(count3 >0) {
count1++;
count2 --;
count3 --;
task::sleep(20);
output << count1 << endl;
output << count2<< endl;
output << count3 << endl;
output << “vex::task::sleep(20)” << endl;

}
output.close();
Brain.Screen.printAt(100,100,“DONE!!”);
}

Hi again. I’m trying to output stuff to my SD card. The “output.txt” file is created and the Brain does print “DONE!!” but for some reason the file is empty. Any help would be appreciated. Thanks!

No idea, I tried the exact same code here and it works. output.txt was filled like this.

1
-1
199
vex::task::sleep(20)
2
-2
198
vex::task::sleep(20)
3
-3
197
vex::task::sleep(20)
4
-4
196
vex::task::sleep(20)
4 Likes