Add kitronic 2
This commit is contained in:
parent
6957c25265
commit
f5aeced9cc
1 changed files with 17 additions and 0 deletions
17
kitronic_02.py
Normal file
17
kitronic_02.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
from microbit import *
|
||||||
|
|
||||||
|
sun = Image("70707:09990:79997:09990:70707")
|
||||||
|
moon = Image("59000:05950:00990:05950:49000")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
while True:
|
||||||
|
light = pin0.read_analog()
|
||||||
|
if light < 200:
|
||||||
|
display.show(moon)
|
||||||
|
else:
|
||||||
|
display.show(sun)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in a new issue