V2.0
Dependencies: mbed
main.cpp
- Committer:
- Sumobot
- Date:
- 2017-10-25
- Revision:
- 0:c2333cdfbcfa
File content as of revision 0:c2333cdfbcfa:
#include "mbed.h" Serial pc(USBTX, USBRX, 9600); // tx, rx Serial device(p9, p10, 9600); // tx, rx DigitalOut RTS(p7); DigitalIn CTS(p8); int flag=1; int main() { pc.printf("Inicio de Programa \n\r"); wait(.1); pc.printf("El valor de CTS inicial es %d\n\r",CTS.read()); RTS=0; while(flag==1){ flag=CTS.read(); wait(.1); pc.printf("El valor de flag es %d\n\r", flag); } /*device.putc(0XAA); device.putc(0X05); device.putc(0X07); device.putc(0X66); device.putc(0XB0);*/ wait(.1); RTS=1; wait(.1); while(1) { pc.putc(device.getc()); } }