system, descripcion y ejemplo

Dependencies:   mbed

Committer:
sherckuith
Date:
Tue Apr 03 21:06:31 2012 +0000
Revision:
0:9b20d4530075
system, descripcion y ejemplo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sherckuith 0:9b20d4530075 1 #include "mbed.h"
sherckuith 0:9b20d4530075 2 /* system example : DIR */
sherckuith 0:9b20d4530075 3 #include <stdio.h>
sherckuith 0:9b20d4530075 4 #include <stdlib.h>
sherckuith 0:9b20d4530075 5
sherckuith 0:9b20d4530075 6 int main ()
sherckuith 0:9b20d4530075 7 {
sherckuith 0:9b20d4530075 8 int i;
sherckuith 0:9b20d4530075 9 printf ("Checking if processor is available...");
sherckuith 0:9b20d4530075 10 if (system(NULL)) puts ("Ok");
sherckuith 0:9b20d4530075 11 else exit (1);
sherckuith 0:9b20d4530075 12 printf ("Executing command DIR...\n");
sherckuith 0:9b20d4530075 13 i=system ("dir");
sherckuith 0:9b20d4530075 14 printf ("The value returned was: %d.\n",i);
sherckuith 0:9b20d4530075 15 return 0;
sherckuith 0:9b20d4530075 16 }