As mentioned previously, we are able to interact with the Blue Dot app in more ways than just a simple button press. The Blue Dot app can interpret where on the button a user presses, as well as detect double presses and swipes. In the following code, we will read from the Blue Dot app using Python.
Reading our button state using Bluetooth and Python
Reading button information using Python
Do the following :
- Open up Thonny from Application Menu | Programming | Thonny Python IDE
- Click on the New icon to create a new file
- Type the following into the file:
from bluedot import BlueDot
from signal import pause
class BlueDotButton:
def swiped(swipe):
if swipe.up:
print("Blue Dot Swiped Up"...