Send bits using pyserial

2.7k Views Asked by At

I am writing a program to send DALI commands via serial port. So, at this case, I got various problems. First of all, DALI commands are messages of 19 bits for questions (1 start bit, 8 adress bits, 8 command bits and 2 stop bits) and 11 bits for answers(1 start bit, 8 response bits, and 2 stop bits). The problem is the fact that with pyserial I can only send bytes via serial port, not bits, and, if I convert that bits to a byte, I need 3 bytes for a question and 2 for and answer with bits unused... How it's supposed to do that. Is there any way to send bits one by one via serial port using pyserial?

0

There are 0 best solutions below