From 966b3fca028e889d4a7f9db66789578682d693cd Mon Sep 17 00:00:00 2001 From: pfitouss Date: Wed, 1 Jun 2016 12:07:04 +0200 Subject: [PATCH] envoie 1er juin avec debut arduino --- arduino_tp/.premier_prog.c.swp | Bin 0 -> 12288 bytes arduino_tp/.prog_afich.c.swp | Bin 0 -> 12288 bytes arduino_tp/a.out | Bin 0 -> 7296 bytes arduino_tp/arduino.txt | 13 +++++++++++++ arduino_tp/premierprog.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ arduino_tp/repertoire.c | 18 ++++++++++++++++++ 6 files changed, 77 insertions(+), 0 deletions(-) create mode 100644 arduino_tp/.premier_prog.c.swp create mode 100644 arduino_tp/.prog_afich.c.swp create mode 100755 arduino_tp/a.out create mode 100644 arduino_tp/arduino.txt create mode 100644 arduino_tp/premierprog.c create mode 100644 arduino_tp/repertoire.c diff --git a/arduino_tp/.premier_prog.c.swp b/arduino_tp/.premier_prog.c.swp new file mode 100644 index 0000000..24cfa23 Binary files /dev/null and b/arduino_tp/.premier_prog.c.swp differ diff --git a/arduino_tp/.prog_afich.c.swp b/arduino_tp/.prog_afich.c.swp new file mode 100644 index 0000000..4c14f9d Binary files /dev/null and b/arduino_tp/.prog_afich.c.swp differ diff --git a/arduino_tp/a.out b/arduino_tp/a.out new file mode 100755 index 0000000..50dfe0a Binary files /dev/null and b/arduino_tp/a.out differ diff --git a/arduino_tp/arduino.txt b/arduino_tp/arduino.txt new file mode 100644 index 0000000..01db4c9 --- /dev/null +++ b/arduino_tp/arduino.txt @@ -0,0 +1,13 @@ +///////////////////////////// arduino /////////////////////////// + +Arès le branchement +avec la commande + +ls -l /dev/*tty* + + +crw-rw---- 1 root dialout 166, 0 juin 1 09:56 /dev/ttyACM0 + +le programme d'allumage de led a été réalisé avec succes + + diff --git a/arduino_tp/premierprog.c b/arduino_tp/premierprog.c new file mode 100644 index 0000000..3787f5c --- /dev/null +++ b/arduino_tp/premierprog.c @@ -0,0 +1,46 @@ + +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + +char car; +char a; + +int ard = open("/dev/ttyACM0",O_RDWR); + + while(1) + { + read(ard, &car, 1); + printf ("%c",car); + + switch(car) { + + case 'A': + a = '1'; + break; + case 'B': + a = '6'; + break; + case 'C': + a = '3'; + break; + case 'D': + a = '4'; + break; + case 'E': + a = '5'; + break; } + + write(ard,&a,1); + } + close(ard); +} + + diff --git a/arduino_tp/repertoire.c b/arduino_tp/repertoire.c new file mode 100644 index 0000000..9b2bb5b --- /dev/null +++ b/arduino_tp/repertoire.c @@ -0,0 +1,18 @@ + +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + + + + +} + + -- libgit2 0.21.2