How can i send 8-bit data or binary data with pyserial?

O

ouz as

i have an electronic module which only understand binary data.
i use python pyserial.
for example the module starts when 001000000 8-bit binary data sent.but
pyserial sent only string data.
Can i send this binary data with pyserial or another way with python.

Thanks,

_________________________________________________________________
Depolama alani sikintisindan kurtulun - hemen Hotmail'e üye olun!
http://odeme.hotmail.com.tr
 
D

Diez B. Roggisch

i have an electronic module which only understand binary data.
i use python pyserial.
for example the module starts when 001000000 8-bit binary data sent.but
pyserial sent only string data.
Can i send this binary data with pyserial or another way with python.

Strings _are_ binary data. Use the module struct to convert data from more
convenient representations (numbers) to strings, or use chr() to convert
them yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top