![](/media/cache/group/mebd_thumbnail.jpg.50x50_q85.jpg)
L432がUARTを受信する予定だったけど動かない
Dependencies: mbed BufferedSerial
Diff: main.cpp
- Revision:
- 0:c31f3c17df9c
- Child:
- 1:196422c79186
diff -r 000000000000 -r c31f3c17df9c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 03 06:32:58 2022 +0000 @@ -0,0 +1,34 @@ +/* mbed Microcontroller Library + * Copyright (c) 2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "mbed.h" +//#include "BufferedSerial.h" + +//BufferedSerial L432(PA_2,PA_3,9600); +//BufferedSerial im920(PA_9,PA_10,38400); +Serial L432(PA_2,PA_3,9600); +Serial im920(PA_9,PA_10,38400); + +DigitalOut led(LED1); + +//BufferedSerial pc(USBTX,USBRX); +//char str[15]; +//int i=0; + +int main(){ + //f303.baud(9600); + //pc.baud(9600); + //led=0; + char temp; + while(1){ + if(L432.readable()) { //f303からのデータがある場合 + printf("readable\r\n"); + led=!led; + temp = L432.getc();//一文字読み込む + im920.printf("TXDA %c\r\n",temp); + //str[i++] = temp; + } + } +}