Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Zeigt bei Tastendruck verschiedene Bilder an
- # Copyright 2023, 2024 Roland Richter [Mu: BBC micro:bit]
- import microbit
- while True:
- if microbit.button_a.is_pressed():
- # MicroPython hat viele vordefinierte Bilder, aber manche davon
- # (z.B. ←) gibt's in OpenRoberta nicht. Hier aber kann ich einfach
- microbit.display.show(microbit.Image.ARROW_W)
- # schreiben. Die Liste aller vordefinierten Bilder gibt's auf
- # https://microbit-micropython.readthedocs.io/en/latest/tutorials/images.html
- elif microbit.button_b.is_pressed():
- # Der Text unten soll so ähnlich wie ein 5x5 Pixel großer → aussehen
- microbit.display.show(microbit.Image("00900:"
- "00090:"
- "99999:"
- "00090:"
- "00900"))
- else:
- microbit.display.clear()
- # PROBIERE, das Zeichen ↔ anzuzeigen, wenn beide Tasten gleichzeitig gedrückt sind.
- # ----------------------------------------------------------------------
- # This program is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement