USB A

Table of Contents

  1. Hello World

The USB-A socket enables the mbed to be used as a host, which means it could potentially use all sorts of USB devices as if it were a PC.

USB-A

Hello World

In this example, we will write "hello.txt" onto a USB flash disk.

Wiring :

USB-Ambed
VccVu (5v)
D+D+
D-D-
GNDGND

Import program

00001 #include "mbed.h"
00002 #include "MSCFileSystem.h"
00003 
00004 MSCFileSystem fs ("fs");
00005 
00006 int main () {
00007 
00008     FILE *fp = fopen("/fs/hello.txt","w");
00009     fprintf(fp,"Hello world!\n");
00010     fclose (fp);
00011 
00012 }

All wikipages