A small package for communicating with an arduino using commands
Project description
Pyducontrol
A python package used to send commands from python to an arduino board.
What is it?
Pyducontrol is a communication form which sends messages over serial to an arduino board. The messages can be easily read by the arduino either as a string or an integer.
Included commands and their syntaxes
- defArduino(port, baudrate, timeout):
- This line must be included first in your project, outside of any loops. It defines the arduino and calls for serial communication in python.
- Arguments:
- port: This is the name of the port the arduino can be reached on e.g.: 'COM3'. '' symbols must be used. You can get the port name from the arduino IDE.
- baudrate: Baud rate of the communication. Integer. E.g.: 9600
- timeout: Defines the timeout value of the serial communication. Float. E.g.: .1
- writeArduino(msg):
- Sends the msg message over the serial to the board encoded as utf-8. Message is automatically ended with a line break (\n) character.
- ewriteArduino(msg):
- Sends the msg message over the serial to the board encoded as utf-8.
How to use?
Import the package to your python project. Include the defArduino line at the start of your code. You will need some code on your arduino setting up the serial communication. Other than that, the messages sent with ewriteArduino can be simply read as a string or integer by the arduino board. Make sure that the baud rates match.
Pre built messaging system
If you want an easier approach, use the writeArduino function. It will close your message with a line break, which the arduino can be configured to detect. See example or template for details.
Dependencies
- pyserial
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyducontrol_csongoose-0.0.2.tar.gz.
File metadata
- Download URL: pyducontrol_csongoose-0.0.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7a5956a93a8018de63ddf57f00a5e8059bc495e36688d1b9b0a82d0dbbe7649
|
|
| MD5 |
f26f55e2a834a72f8ef66887c7c10ea4
|
|
| BLAKE2b-256 |
71500e40ffd31e0160af249c74608ecf55be366c49d1bb535ebbe753dac73084
|
File details
Details for the file pyducontrol_csongoose-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pyducontrol_csongoose-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
330325d5309cbfc322327a3e90269630ad6d7c6a14c52897dda9177eef2fc81c
|
|
| MD5 |
f4fe3efce2ff294d0f32849f64500e49
|
|
| BLAKE2b-256 |
0494e0686939ca819eb1aeff5d3fca16efd83c1f4547c225f0a71b120f45fa78
|