dani barbosa
/
Nucleo_interf_bluetooth
Faire clignoter les LEDs et relever la mesure du temps d'un tour de rotation.
Revision 0:4f2b552b676e, committed 2021-06-22
- Comitter:
- dani912
- Date:
- Tue Jun 22 12:32:09 2021 +0000
- Commit message:
- projet
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DHT.lib Tue Jun 22 12:32:09 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Wimpie/code/DHT/#9b5b3200688f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HC-05.lib Tue Jun 22 12:32:09 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Kio_Liex/code/HC-05/#e0c6e95761d2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jun 22 12:32:09 2021 +0000 @@ -0,0 +1,76 @@ +#include "mbed.h" + +Serial pc(USBTX,USBRX); +Serial rn(PA_9,PA_10); + +DigitalOut pc_activity(LED1); +DigitalOut uart_activity(LED2); +DigitalOut led1(D2); +DigitalOut led2(PB_0); +DigitalOut led3(PB_1); +DigitalOut led4(PF_0); +DigitalOut led5(D8); +DigitalOut led6(PA_8); +DigitalOut led7(PA_11); +DigitalOut led8(PB_5); + +int main() +{ + + + pc.baud(38400); + rn.baud(38400); + + while(1){ + + led1 = 1; + led2 = 1; + wait_us(500); + led1 = 0; + led2 = 0; + led3 = 1; + led4 = 1; + wait_us(500); + led3 = 0; + led4 = 0; + led5 = 1; + led6 = 1; + wait_us(500); + led5 = 0; + led6 = 0; + led7 = 1; + led8 = 1; + wait_us(500); + led7 = 0; + led8 = 0; + /* char y = rn.getc(); + + if(y == '4'){ + ledv = 1; + ledr = 0; + wait(0.5); + } + else{ + ledv = 0; + ledr = 1; + wait(0.5); + } */ + + + if(pc.readable()) + { + rn.putc(pc.getc()); + pc_activity = !pc_activity; + + + } + if(rn.readable()) + { + pc.putc(rn.getc()); + uart_activity = !uart_activity; + //wait(2); + } + } +} + + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jun 22 12:32:09 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file