Quantcast
Channel: Pimoroni Buccaneers - Latest posts
Viewing all articles
Browse latest Browse all 55227

Need some help with the "Light" module in Python3 please

$
0
0

Today I have tried a different approach based on your first post.
I have used the new __init__.py and light.py files and modified mini-kit.py with the changes needed to connect the Light module. So I have connected the Touch, Light and Rainbow modules and I don't get any error messages. I can continue with my coding, thanks.

I think I've seen an anomaly in the __init__.py code, the following code extract does not look correct, there are 2 channel one's and no channel eight, but as a beginner I may be wrong:

    @property
    def channel_one(self):
        return self._modules[self._channel_names.index('one')]

    @property
    def channel_one(self):
        return self._modules[self._channel_names.index('one')]

    @property
    def channel_two(self):
        return self._modules[self._channel_names.index('two')]

    @property
    def channel_three(self):
        return self._modules[self._channel_names.index('three')]

    @property
    def channel_four(self):
        return self._modules[self._channel_names.index('four')]

    @property
    def channel_five(self):
        return self._modules[self._channel_names.index('five')]

    @property
    def channel_six(self):
        return self._modules[self._channel_names.index('six')]

    @property
    def channel_seven(self):
        return self._modules[self._channel_names.index('seven')]

Viewing all articles
Browse latest Browse all 55227

Trending Articles