Linux PC-based Electronics using Pyboard by Yury Magda & Yury Magda

Linux PC-based Electronics using Pyboard by Yury Magda & Yury Magda

Author:Yury Magda & Yury Magda [Magda, Yury]
Language: eng
Format: azw3
Published: 2017-06-23T04:00:00+00:00


Save the above code in the controlSINE_UART.py file. To execute this script on the pyboard we should enter the following command:

$ python pyboard.py controlSINE_UART.py

To send the command to the pyboard via UART, we will use the following Python script (Listing 8).

Listing 8.

import sys

import serial

if (len(sys.argv) == 3):

param1 = str(sys.argv[1])

param2 = str(sys.argv[2])

str1 = (param1 + ' ' + param2 + '\r\n').encode('utf-8')

port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=3.0)

port.write(str1)

port.close()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.