0% found this document useful (0 votes)
11 views1 page

Python Pseudocode

The document describes opening a serial connection on COM3 at 9600 baud, defining a send_command function to encode and send commands via serial with a delay, and looping to prompt the user for commands and either call send_command or display errors.

Uploaded by

toto071902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Python Pseudocode

The document describes opening a serial connection on COM3 at 9600 baud, defining a send_command function to encode and send commands via serial with a delay, and looping to prompt the user for commands and either call send_command or display errors.

Uploaded by

toto071902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Import serial library

Import time library

Open serial connection (COM3, 9600 baud rate)

Define send_command function:


Accept command as input
Encode command and send it via serial connection
Delay for a short period

Loop:
Prompt user for command input
If command is 'q', exit loop
If command is valid:
Call send_command function with the command
Else, display error message

Close serial connection

You might also like