Vinz1911 / PrimePoweredUP

LEGO SPIKE Prime + PoweredUP come together by using BLE!
MIT License
27 stars 8 forks source link

Use of bitwise shift in constant declarations #2

Closed osullivp closed 3 years ago

osullivp commented 3 years ago

Hi there. Looking at the code in the examples (for instance in remote_basic.py), I notice the constants are declared with bitwise shifts:

self.__IRQ_SCAN_RESULT = const(1 << 4)

rather than simple numbers per the official ubluetooth examples here. Is this intentional?

Regards,

Paul.

Vinz1911 commented 3 years ago

Hi Paul,

Yes, the constants are from an earlier example of the ubluetooth library. The Current Version of ubluetooth has some changes there which are not compatible with the Version of ubluetooth which is currently running on Spike Prime.

I will update examples when Spike Prime gets a new version of micropython :)

osullivp commented 3 years ago

Hi @Vinz1911 ,

Many thanks for confirming. By the way. Your examples have been very helpful and I have used them as the basis for code that attaches to an HM-10 Bluetooth module on an Arduino board I have made.

Regards,

Paul.