[Tutor] Hi

David bouncingcats at gmail.com
Sat Apr 9 19:59:55 EDT 2022


On Sun, 10 Apr 2022 at 03:56, Chidinma Ufomadu <fufomadu894 at gmail.com> wrote:

> I need help with a project. I can't seem to be able to make the green led
> come on when the servo is rotating, the red led just stay on.

Hi,

>     L1.value(1)

The above statement in your code lights the red LED, The nonzero
argument 1 tells the hardware to turn the LED on.

>     L2.value(0)

The above statement in your code turns off the the green LED. The zero
argument 0 tells the hardware to turn the LED off.

> That's the code I have written.
> I don't know what the problem is, please help.

There is no statement anywhere in your code that turns on the green
LED. So, it never gets turned on.

While your question is welcome here, I suggest this mailing list isn't
the best place to ask questions about Python running on
microcontrollers, because most people here are not using Python in
that way.

This mailing list is about helping people to use Python as a universal
language, without concerning itself with the specifics of the
hardware that it is running on.

For that reason, you will get better help by finding a forum which is
targetted to your specific hardware and version of Python.

If you are using circuit python, ask here:
  https://forums.adafruit.com/viewforum.php?f=60

If you are using micropython, ask here:
  https://forum.micropython.org/

Before you ask questions anywhere, searching and reading answers to
previous questions asked in the same place is an excellent way to
learn without having to wait for replies.

Also, it is important for you to understand that the behaviour of Python
running on microcontrollers varies depending on the hardware.

That is not because of Python. It is because in general each different
microcontroller provides different feature capabilities, and Python is
just being used here as an an interface to those capabilities. So it won't
behave the same on every hardware. That's why there are many "ports" (ie
variations) of Python for different hardware.

So just asking about "Python" won't get you the answers you need until you
give more details about the hardware you are using.

I can't even run your code here to test it, because it does not run on
my hardware, and you do not tell us what hardware you are using.

So, when asking for help you will get better answers if you always
state what hardware you are running on, and what version of Python you
are using. If you don't provide that information, it makes it hard for
people to help you. The documentation is different for each different
hardware platform, when there is no operating system running on that
platform to provide a universal interface for Python to use.

I wish you good luck with your project.


More information about the Tutor mailing list