I can not access the mbed after adding the bin file which contains the following code.
#include "mbed.h"
AnalogIn xin(p20);
AnalogIn yin(p19);
LocalFileSystem local("local"); // Create the local filesystem under the name "local"
int main() {
float xval;
float yval;
while(1) {
xval=xin.read();
yval=yin.read();
FILE *fp = fopen("/local/out.txt", "w"); // Open "out.txt" on the local file system for writing
fprintf(fp, "x: %f, y: %f\n", xval, yval);
fclose(fp);
wait_ms(100);
}
}
I thought there is something wrong with the 'while' loop, because I can't access it after adding the while loop.
Does anyone know how to sort this out?
I can not access the mbed after adding the bin file which contains the following code.
#include "mbed.h"
AnalogIn xin(p20);
AnalogIn yin(p19);
LocalFileSystem local("local"); // Create the local filesystem under the name "local"
int main() {
float xval;
float yval;
while(1) {
xval=xin.read();
yval=yin.read();
FILE *fp = fopen("/local/out.txt", "w"); // Open "out.txt" on the local file system for writing
fprintf(fp, "x: %f, y: %f\n", xval, yval);
fclose(fp);
wait_ms(100);
}
}
I thought there is something wrong with the 'while' loop, because I can't access it after adding the while loop.
Does anyone know how to sort this out?