Difference between revisions of "Microbit"

From PrattWiki
Jump to navigation Jump to search
(Created page with "This is most definitely a sandbox page for the micro:bit! == Links == Links first? What? * [https://microbit.org/ micro:bit educational foundation] == Installation == * [ht...")
(No difference)

Revision as of 17:15, 2 June 2022

This is most definitely a sandbox page for the micro:bit!

Links

Links first? What?

Installation

Python

  • Can run from web page, but needs Chrome versus other browsers.

Commands

  • from microbit import *
    • Imports all commands (note: may want to use prefixes at some point!)
  • display.scroll(STR)
    • Scrolls text across 5x5 LCD array
  • display.show(Image.IMG)

Samples

Hour hand rotation

from microbit import *

while True:
    for k in range(12):
        cmd = "display.show(Image.CLOCK{:0.0f})".format(k+1)
        print(cmd)
        exec(cmd)
        sleep(200)