Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Added set_accel helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
Vandy Liu committed Feb 10, 2020
1 parent 120f42d commit 0380c7a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/microbit/__model/accelerometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ def __get_accel(self, axis):
elif axis == "z":
return self.get_z()

def __set_accel(self, axis, accel):
if axis == "x":
self.__x = self.__get_valid_acceleration(x)
elif axis == "y":
self.__y = self.__get_valid_acceleration(y)
elif axis == "z":
self.__z = self.__get_valid_acceleration(z)

def __set_gesture(self, gesture):
if gesture in CONSTANTS.GESTURES:
self.__current_gesture = gesture
Expand Down

0 comments on commit 0380c7a

Please sign in to comment.