April 2020
Intermediate to advanced
294 pages
7h 53m
English
The first step in implementing our gesture class is to create the constructor:
class APDS_9960(): GESTURE_FORWARD = 0x0 GESTURE_BACKWARD = 0x1 GESTURE_LEFT = 0x2 GESTURE_RIGHT = 0x3 def __init__(self,I2CObject, Verbose): print(“Object Initialized!”) def Detect(self): print(“Detecting Gesture …”)
As you can see from the preceding code snippet, we have defined a few variables that will be used to define what gesture was detected, along with the creation of our construction and the main method that will be used to detect a gesture.
Read now
Unlock full access