Comments (5)
Hey Jeremy!
Bools are 1 byte objects both in Arduino/C++ and Python, so they should be compatible automatically. Bools are also automatically supported in pySerialTransfer.
from pyserialtransfer.
You're the best! I'll close this for now. If I run into something weird when I'm putting it into the code I'll just comment here.
from pyserialtransfer.
This totally works by the way!
from pyserialtransfer.
To double check, this means I don't need to do any val_type_overrides
if what's fed into the tx_buffer
is type bool
? See this line for where I'm doing it.
So I could just add this to the transfer:
metaData_size = link.tx_obj(arduino_metadata['lickContingency'], metaData_size)
lickContingency
is a Boolean value (literally True
or False
)
from pyserialtransfer.
metaData_size = link.tx_obj(arduino_metadata['lickContingency'], metaData_size)
should be fine because Python will automatically create a value type format for the transmission if the payload object is of a built-in Python type (i.e. bool):
tx_obj():
pySerialTransfer/pySerialTransfer/pySerialTransfer.py
Lines 253 to 274 in 782c4ab
I'd say give it a shot and see if it works
from pyserialtransfer.
Related Issues (20)
- Check for CRC error HOT 1
- Is there a maximum variable size for "x" when using myTransfer.sendDatum("x")? HOT 12
- Serial port doesnโt stay connected HOT 2
- Send encoder data HOT 6
- Can we use this library on Raspberry Pi for communication through GPIO? HOT 2
- Are there any examples showing how to save received file to a PC folder. HOT 1
- Data array sometimes gets corrupted if some values are present HOT 5
- Enhancement Proposal: Modernizing pySerialTransfer Python Client for Improved Code Quality and Practices HOT 2
- Migrate to use `pyproject.toml` for project specification HOT 1
- `num_bytes` variable shadows outer scope
- variable naming convention is inconsistent
- `crc` variable shadows the name from the outer scope
- Use isinstance() for Type Checking
- Unused functions in `pySerialTransfer.py`
- Project has no test coverage HOT 2
- larger values of `crc_len` can cause a `MemoryError`
- bools mis-classified as ints when using `tx_obj`
- `tick()` called with `debug=False` only logs `CRC_ERROR` when there is an error
- `set_callbacks` does not require all items to be callable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyserialtransfer.