diff --git a/sense_hat/stick.py b/sense_hat/stick.py index 896a9f8..eeba2b2 100644 --- a/sense_hat/stick.py +++ b/sense_hat/stick.py @@ -197,6 +197,15 @@ def wait_for_event(self, emptybuffer=False): if event: return event + def clear_events(self): + """ + Clear all outstanding events + """ + + while( self._read() != None): + pass + + def get_events(self): """ Returns a list of all joystick events that have occurred since the last