TypeError: tipos de operandos no admitidos para &: 'float' e 'int'

TypeError: tipos de operandos no admitidos para &: 'float' e 'int'

self.write(self.__LED0_OFF_L+4*channel, off & 0xFF)
self.write(self.__LED0_OFF_H+4*channel, off >> 8)

cambiar a:

self.write(self.__LED0_OFF_L+4*channel, int(off) & 0xFF)
self.write(self.__LED0_OFF_H+4*channel, int(off) >> 8)

Supongo que te gusta

Origin blog.csdn.net/pvmsmfchcs/article/details/133151842
Recomendado
Clasificación