Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:253a9226eb5b
- Child:
- 1:a770d742e28a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 28 03:46:38 2014 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" +#include <fstream> + +Serial pc(USBTX, USBRX); // tx, rx + DigitalOut myled1(LED1); + DigitalOut myled2(LED2); + DigitalOut myled3(LED3); + DigitalOut myled4(LED4); + + LocalFileSystem local("local"); // Create the local filesystem under the name "local" +int read_buffer[100][20]; + + +int main() { + int index = 0; + FILE *fp = fopen("/local/packet.txt", "w"); + for(; index < 10; index++){ + read_buffer[0][index] = pc.getc(); + fprintf(fp,"%d",read_buffer[0][index]); + fprintf(fp,"."); + + if(index%2 == 0){ + myled1 =1; + myled2 = 0; + } + else{ + myled1 =0; + myled2 = 1; + } + + + } + fclose(fp); + myled1 = 1; + +}