Add kitronic 4 and 5

This commit is contained in:
Gabriel Augendre 2021-03-21 08:40:47 +01:00
parent 4f2befc8f0
commit 70b253c85f
2 changed files with 29 additions and 0 deletions

18
kitronic_04.py Normal file
View file

@ -0,0 +1,18 @@
from microbit import *
def main():
duty = 0
while True:
while duty < 1023:
pin0.write_analog(duty)
duty += 1
sleep(10)
while duty > 0:
pin0.write_analog(duty)
duty -= 1
sleep(10)
if __name__ == "__main__":
main()

11
kitronic_05.py Normal file
View file

@ -0,0 +1,11 @@
from microbit import *
def main():
while True:
value = min(1023, abs(accelerometer.get_y()))
pin0.write_analog(value)
if __name__ == "__main__":
main()