Пример #1
0
    lambda: tutorial.check_for_pro(),
    """Great! Your Explorer HAT Pro looks like it's plugged in
and ready to go. Let's start reading some analog values.

You should have a little blue Rotary Potentiometer wired up
to Analog 1 on your Explorer HAT Pro breadboard!
""",
    lambda: tutorial.wait_for_space(),
    """Now to read the analog value you'll need to use:

    explorerhat.analog.one.read()

Try it:
""",
    lambda: tutorial.wait_for_input("explorerhat.analog.one.read()"),
    lambda: tutorial.print_value("Analog One", tutorial.explorerhat.analog.one.read()),
    """Now turn the potentiometer slightly and try again:

    explorerhat.analog.one.read()
""",
    lambda: tutorial.wait_for_input("explorerhat.analog.one.read()"),
    lambda: tutorial.print_value("Analog One", tutorial.explorerhat.analog.one.read()),
    """If everything went to plan you should see a different value.

Getting an analog value into your Python code is that simple,
now you can use it to control motors, adjust the brightness of
LEDs or whatever you can imagine!

That's all for now, press space to exit!""",
    lambda: tutorial.wait_for_space(),
])
Пример #2
0
    lambda: tutorial.importme(),
    """Great! Your Explorer HAT looks like it's plugged in
and ready to go. Let's start reading some digital values.

The easiest way to input a digital value is with a male to
male jump wire. Make sure you've got one handy!
""",
    lambda: tutorial.wait_for_space(),
    """Now to read a digital value you'll need to use:

    explorerhat.input.one.read()

Try it:
""",
    lambda: tutorial.wait_for_input("explorerhat.input.one.read()"),
    lambda: tutorial.print_value("Input One", tutorial.explorerhat.input.one.read()),
    """Now, use your jump wire to connect input one to 5V.

And ready the input again:

    explorerhat.input.one.read()
""",
    lambda: tutorial.wait_for_input("explorerhat.input.one.read()"),
    lambda: tutorial.print_value("Input One", tutorial.explorerhat.input.one.read()),
    """If everything went to plan you should see a different value.

Getting a digital value into your Python code is that simple,
now you can add all the tactile buttons you could ever need!

That's all for now, press space to exit!""",
    lambda: tutorial.wait_for_space(),
Пример #3
0
    lambda: tutorial.check_for_pro(),
    """Great! Your Explorer HAT Pro looks like it's plugged in
and ready to go. Let's start reading some analog values.

You should have a little blue Rotary Potentiometer wired up
to Analog 1 on your Explorer HAT Pro breadboard!
""",
    lambda: tutorial.wait_for_space(),
    """Now to read the analog value you'll need to use:

    explorerhat.analog.one.read()

Try it:
""",
    lambda: tutorial.wait_for_input("explorerhat.analog.one.read()"),
    lambda: tutorial.print_value("Analog One",
                                 tutorial.explorerhat.analog.one.read()),
    """Now turn the potentiometer slightly and try again:

    explorerhat.analog.one.read()
""",
    lambda: tutorial.wait_for_input("explorerhat.analog.one.read()"),
    lambda: tutorial.print_value("Analog One",
                                 tutorial.explorerhat.analog.one.read()),
    """If everything went to plan you should see a different value.

Getting an analog value into your Python code is that simple,
now you can use it to control motors, adjust the brightness of
LEDs or whatever you can imagine!

That's all for now, press space to exit!""",
    lambda: tutorial.wait_for_space(),