EE149
/
FinalProject
Final Project files for mBed development.
Diff: control.c
- Revision:
- 14:41fa8b95a9ab
- Parent:
- 12:1aa6b8a74136
diff -r 070846d87d4a -r 41fa8b95a9ab control.c --- a/control.c Sun Nov 16 09:17:20 2014 +0000 +++ b/control.c Fri Nov 28 21:08:55 2014 +0000 @@ -16,14 +16,12 @@ void get_ps_file(char* moves) { - char* contents; + LocalFileSystem local("local"); FILE* fp = fopen(_CANVAS_FILE, "r"); fseek(fp, 0L, SEEK_END); int size = ftell(fp); fseek(fp, 0L, SEEK_SET); - contents = (char*)malloc(size); - fread(contents, size, 1, fp); - memcpy(moves, contents, size); + fread(moves, size, 1, fp); fclose(fp); } @@ -55,6 +53,7 @@ } forward(10); right(90); + // // Right now the robot controller is clearly a very basic // 'hello world' loop that must be changed.