Skip to content

Problem with Color Sensor #9

Description

@aeblik

For a school project we are trying to work with the color sensor. We don't understand how to use the implemented functions. We tried the following approach:

from lib.interface import Interface
from serial.tools import list_ports

available_ports = list_ports.comports()
print(f'available ports: {[x.device for x in available_ports]}')

port = available_ports[0].device
bot = Interface(port)

print('Bot status:', 'connected' if bot.connected() else 'not connected')

bot.set_color_sensor(1, True, port, version="2")

But keep running into a struct.error in the parsers library: "required argument is not an integer". Specifically in line 82.

Did anyone have success with the color sensor or is somehow able to help us?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions