Commit 966b3fca028e889d4a7f9db66789578682d693cd

Authored by pfitouss
1 parent b3e78c20

envoie 1er juin avec debut arduino

arduino_tp/.premier_prog.c.swp 0 → 100644
No preview for this file type
arduino_tp/.prog_afich.c.swp 0 → 100644
No preview for this file type
arduino_tp/a.out 0 → 100755
No preview for this file type
arduino_tp/arduino.txt 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +///////////////////////////// arduino ///////////////////////////
  2 +
  3 +Arès le branchement
  4 +avec la commande
  5 +
  6 +ls -l /dev/*tty*
  7 +
  8 +
  9 +crw-rw---- 1 root dialout 166, 0 juin 1 09:56 /dev/ttyACM0
  10 +
  11 +le programme d'allumage de led a été réalisé avec succes
  12 +
  13 +
... ...
arduino_tp/premierprog.c 0 → 100644
... ... @@ -0,0 +1,46 @@
  1 +
  2 +#include <stdlib.h>
  3 +#include <stdio.h>
  4 +#include <string.h>
  5 +#include <unistd.h>
  6 +#include <sys/types.h>
  7 +#include <sys/stat.h>
  8 +#include <fcntl.h>
  9 +
  10 +int main(void)
  11 +{
  12 +
  13 +char car;
  14 +char a;
  15 +
  16 +int ard = open("/dev/ttyACM0",O_RDWR);
  17 +
  18 + while(1)
  19 + {
  20 + read(ard, &car, 1);
  21 + printf ("%c",car);
  22 +
  23 + switch(car) {
  24 +
  25 + case 'A':
  26 + a = '1';
  27 + break;
  28 + case 'B':
  29 + a = '6';
  30 + break;
  31 + case 'C':
  32 + a = '3';
  33 + break;
  34 + case 'D':
  35 + a = '4';
  36 + break;
  37 + case 'E':
  38 + a = '5';
  39 + break; }
  40 +
  41 + write(ard,&a,1);
  42 + }
  43 + close(ard);
  44 +}
  45 +
  46 +
... ...
arduino_tp/repertoire.c 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +
  2 +#include <stdlib.h>
  3 +#include <stdio.h>
  4 +#include <string.h>
  5 +#include <unistd.h>
  6 +#include <sys/types.h>
  7 +#include <sys/stat.h>
  8 +#include <fcntl.h>
  9 +
  10 +int main(void)
  11 +{
  12 +
  13 +
  14 +
  15 +
  16 +}
  17 +
  18 +
... ...