LPC
Dependencies: mbed MotorDrivers
Revision 0:b11edd0d95ed, committed 2020-10-07
- Comitter:
- shibazakiwataru
- Date:
- Wed Oct 07 08:53:21 2020 +0000
- Commit message:
- LPC
Changed in this revision
diff -r 000000000000 -r b11edd0d95ed MotorDrivers.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MotorDrivers.lib Wed Oct 07 08:53:21 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/sink/code/MotorDrivers/#9dd052490f0a
diff -r 000000000000 -r b11edd0d95ed main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 07 08:53:21 2020 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "string" + +RawSerial con(D5,D4,115200); +RawSerial pc (USBTX,USBRX,115200); +Ticker tras; +//Ticker USBtx; +string tras_str = ""; +string USBtx_str = ""; +void atras(){ + char con_c = con.getc(); + tras_str += con_c; + if(con_c == '\n'){ + USBtx_str = tras_str; + tras_str = ""; + } +} +void aUSBtx(){ + con.putc(255); + con.putc(255); + con.putc(255); + con.putc(0b00000000); + con.putc('\n'); + pc.printf(USBtx_str.c_str()); +} +int main() +{ + tras.attach(&aUSBtx,0.5); + + con.attach(&atras,RawSerial::RxIrq); + while(1) { + } +}
diff -r 000000000000 -r b11edd0d95ed mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 07 08:53:21 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file