串口发送有问题
-
请问我在做串口发送的时候tx一直是高电平,用的例程,是硬件问题吗?rx没有问题
-
- 程序是什么?需要贴出来。
- 你是怎么确定tx一直是高电平?用示波器还是usb转串口模块?
-
我用的例程,波形是用示波器测的
-
- 把具体的代码贴出来
- 你确定没有测量错引脚?
-
Hello World Example
Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!
import sensor, image, time
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.while(True):
clock.tick() # Update the FPS clock.
img = sensor.snapshot() # Take a picture and return the image.
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
# to the IDE. The FPS should increase once disconnected.
-
绝对没有测错,我检查过了
-
-
不好意思我贴错。。。。。。
-
UART Control
This example shows how to use the serial port on your OpenMV Cam. Attach pin
P4 to the serial input of a serial LCD screen to see "Hello World!" printed
on the serial LCD display.
import time
from pyb import UARTAlways pass UART 3 for the UART number for your OpenMV Cam.
The second argument is the UART baud rate. For a more advanced UART control
example see the BLE-Shield driver.
uart = UART(3, 115200, timeout_char = 1000)
while(True):
uart.write("Hello World!\r")
time.sleep(1000)
-
不清楚你哪里的问题
-
我这边和电脑发正常,但是和stm32单片机发就有问题,得到的数不对
-
你不是说你用示波器一直是高电平?怎么和电脑又正常了?
-
现在测也是高电平,但是发数正常,换到32单片机上,单片机可以接受但是接收到的数不对
-
目测
- 你不会用示波器
- stm32 上程序不对
-
不好意思,我这边的单片机串口引脚坏了,换了个单片机都好用了