Search Forums by tag:
Serial, mbed, compiler, ethernet, USB, I2C, SPI, interrupt, LCD, library, bug, HTTPServer, CAN, adc, AnalogIn, memory, SD Card, InterruptIn, rpc, Power, SDFileSystem, Ticker, canbus, driver, editor, Error, LocalFileSystem, UART, libraries, TCP, GPS, PwmOut, timer, pwm, file, website, accelerometer, C++, reset, SDCard, RTC, interrupts, clock, DigitalIn, TCPSocket, frequency, led, Java, http, buffer, DMA, SD, flash, HTTPClient, pinball, MODSERIAL, problem, printf, filesystem, SerialPC, RFID, beta, LPC1768, rtos, newbie, compile, digitalOut, Servo, UDP, audio, LPC11U24, RPCFunction, EthernetNetIf, NetServices, m3pi, Download, write, socket, multiple, array, sensor, keil, MATLAB, Forum, debug, hardware, Board, I2S, dead, Sleep, xbee, Nokia6610, AnalogOut, tcp/ip, SPI Slave, code, voltage, wait, network, read, suggestion, dac, JTAG, string, pc, keyboard, copy, GPRS, offline, lwip, Speed, DHCP, Data Logging, windows, time, current, MODDMA, mp3, C, gcc, attach, fatfilesystem, USB Host, publish, assembly, stepper motor, WavePlayer, camera, size, VGA, import, documentation, baud, bluetooth, TextLCD, firmware, M0, pullup, Relay, timing, pololu, MIDI, compiler error codes, magjack, client, robot, Communication, stream, HID, breakout, FIFO, prototype, GPIO, sampling, api, binary, filter, ADXL345, program, DSP, help, sram, class, suggestions, email, PING, arduino, rs232, link, wifi, Nokia, browser, control, Host, Eagle, Modbus, ide, linux, port, updates, Cortex-M0, WiFly, DMX, files, scanf, protocol, PPP, FTP, integer, function, latency, serial port, modem, motors, for, monitor, malloc, Digital I/O, Production, FAT, classes, server, webserver, delay, variables, flashing, time-triggered, PCB, c programming, Analog, labview, watchdog, Encoder, post, math, LPCXpresso, MBED website, GSM, storage, nxp, mobileLCD, license, Terminal, int, counter, baseboard, rj45, EEPROM, E289, mac, Timeout, news, connect, pointers, Optocoupler, Robotics, search, USBMIDI, glitch, find, real-time, format, slave, driverlibrary, MODGPS, processing, networking, ID, umts, float, color, BUTTON, Images, wave, bin, const, OSX, supply, peripheral, sensors, RIT, character, bus, ARM, SRF08, heap, output, basic, piezo, pins, keypad, ID12, Pachube, player, DigitalInOut, object, capture, slow, PSP, OS, display, syntax, mbed.lib, EmbeddedArtists, NMEA, paste, project, GUI, UART0, firefox, motor, SQL, RAM, 3D, bugs, Temperature, not, I/O, Bidirectional, rss, resolved, Pin, Assembler, LED1, LIS302, getc, Safari, Vin, wiki, registers, PS2, fopen, BusOut, projects, RS485, pythonHi Xue,
Your code is accessing the LocalFileSystem, and whenever you have one or more files open, it will not be visible to the PC (you can't have two masters basically). As your program is always holding on to a file and hence the filesystem, you will never give it back to the PC.
The solution is simply to hold down the reset button. As the micro and hence the program won't be running, the PC will be able to see the Filesystem fine.
See http://mbed.org/handbook/LocalFileSystem for the full explanation.
Simon
Thanks for your help. I have solved that problem.Simon Ford wrote:
Hi Xue,
Your code is accessing the LocalFileSystem, and whenever you have one or more files open, it will not be visible to the PC (you can't have two masters basically). As your program is always holding on to a file and hence the filesystem, you will never give it back to the PC.
The solution is simply to hold down the reset button. As the micro and hence the program won't be running, the PC will be able to see the Filesystem fine.
See http://mbed.org/handbook/LocalFileSystem for the full explanation.
Simon
Would you do me another favor? I am recording the voltage information from the pin19 and pin20 as you can see from the code. What I am expecting is to record hundreds of voltage values a time rather than once a time. I was supposed to use a 'while' loop to perform it, well, actually I mess it up. Would you mind suggesting me a idea to work it out?
What I am expecting is to record hundreds of voltage values a time rather than once a time. I was supposed to use a 'while' loop to perform it, well, actually I mess it up. Would you mind suggesting me a idea to work it out?
It seems that your program is reopening the file for each round so old values will be overwritten.
Please log in to post a reply.


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?