This repository was archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
re-organized structure for autocorrect #193
Merged
Andrea Mah (andreamah)
merged 19 commits into
dev
from
users/t-anmah/autocomplete-organizational-changes
Feb 10, 2020
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9861dc4
re-organized structure for autocorrect
andreamah b7f9036
fixed silly mistakes
andreamah 96dea23
more silly mistakes fixed
andreamah ea8d768
re-formatting
andreamah 54b1888
resolved merge conflicts
andreamah 765a126
added correct display func
andreamah 6229a13
before merge
66d18ab
Merge branch 'users/t-anmah/autocomplete-organizational-changes' of h…
52b62f4
fixed cpx tests
andreamah 3797515
undid utils change
andreamah ae46d15
Added docstring to public functions
45196f7
Merge branch 'users/t-anmah/autocomplete-organizational-changes' of h…
6f38621
removed docstring for image init
056637e
changed image class ref to docs
andreamah be9f389
Merge branch 'users/t-anmah/autocomplete-organizational-changes' of h…
andreamah d42f261
Updated doc references
ac3df71
Merge branch 'dev' into users/t-anmah/autocomplete-organizational-cha…
andreamah 073a610
resolved merge conflicts
andreamah a01baf1
Merge branch 'users/t-anmah/autocomplete-organizational-changes' of h…
andreamah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,24 @@ | ||
| from .shim import * | ||
| from .__model.image import Image | ||
| from .__model.microbit_model import __mb | ||
|
|
||
| button_a = __mb.button_a | ||
| button_b = __mb.button_b | ||
| display = __mb.display | ||
|
|
||
|
|
||
| def sleep(n): | ||
| """ | ||
| Wait for ``n`` milliseconds. One second is 1000 milliseconds, so:: | ||
| microbit.sleep(1000) | ||
| will pause the execution for one second. ``n`` can be an integer or | ||
| a floating point number. | ||
| """ | ||
| __mb.sleep(n) | ||
|
|
||
|
|
||
| def running_time(): | ||
| """ | ||
| Return the number of milliseconds since the board was switched on or | ||
| restarted. | ||
| """ | ||
| __mb.running_time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| class Button: | ||
| # The implementation is based off of https://microbit-micropython.readthedocs.io/en/v1.0.1/button.html. | ||
| def __init__(self): | ||
| self.__pressed = False | ||
| self.__presses = 0 | ||
| self.__prev_pressed = False | ||
|
|
||
| def is_pressed(self): | ||
| """ | ||
| Returns ``True`` if the specified button ``button`` is currently being | ||
| held down, and ``False`` otherwise. | ||
| """ | ||
| return self.__pressed | ||
|
|
||
| def was_pressed(self): | ||
| """ | ||
| Returns ``True`` or ``False`` to indicate if the button was pressed | ||
| (went from up to down) since the device started or the last time this | ||
| method was called. Calling this method will clear the press state so | ||
| that the button must be pressed again before this method will return | ||
| ``True`` again. | ||
| """ | ||
| res = self.__prev_pressed | ||
| self.__prev_pressed = False | ||
| return res | ||
|
|
||
| def get_presses(self): | ||
| """ | ||
| Returns the running total of button presses, and resets this total | ||
| to zero before returning. | ||
| """ | ||
| res = self.__presses | ||
| self.__presses = 0 | ||
| return res | ||
|
|
||
| def __press_down(self): | ||
| self.__pressed = True | ||
| self.__prev_pressed = True | ||
| self.__presses += 1 | ||
|
|
||
| def __release(self): | ||
| self.__pressed = False |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.