mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
22 lines
670 B
Python
22 lines
670 B
Python
# This work is licensed under the MIT license.
|
|
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
|
|
# https://github.com/openmv/openmv/blob/master/LICENSE
|
|
#
|
|
# 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 UART
|
|
|
|
# Always 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, 19200)
|
|
|
|
while True:
|
|
uart.write("Hello World!\r")
|
|
time.sleep_ms(1000)
|