Vítejte na mém webu

Já


Vlhkoměr

        
# Write your code here :-)
from microbit import *
led.set_brightness(64) #šetří se energie
reading = 0

def on_forever():
    global reading
    pins.analog_write_pin(AnalogPin.P1, 1023)
    reading = pins.analog_read_pin(AnalogPin.P0)
    pins.analog_write_pin(AnalogPin.P1, 0)
    led.plot_bar_graph(reading, 1023)
    if input.button_is_pressed(Button.A):
        basic.show_number(reading)
    basic.pause(5000)
basic.forever(on_forever)