Files
mraa/examples/python/uart.py
Thomas Ingleby 170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00

24 lines
399 B
Python

#!/usr/bin/env python
# Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
# Copyright (c) 2018 Linaro Ltd.
#
# SPDX-License-Identifier: MIT
#
# Example Usage: Sends data through UART
import mraa
import time
import sys
# serial port
port = "/dev/ttyACM0"
data = 'Hello Mraa!'
# initialise UART
uart = mraa.Uart(port)
# send data through UART
uart.write(bytearray(data, 'utf-8'))