Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install anki_vector #228

Open
Readyornot69 opened this issue Dec 29, 2024 · 0 comments
Open

pip install anki_vector #228

Readyornot69 opened this issue Dec 29, 2024 · 0 comments

Comments

@Readyornot69
Copy link

import anki_vector
from anki_vector.util import Color

def set_eye_color(robot: anki_vector.Robot, color_name: str):
# Define RGB values for the colors
colors = {
"red": Color(255, 0, 0),
"blue": Color(0, 0, 255),
"white": Color(255, 255, 255),
"pink": Color(255, 105, 180)
}

if color_name in colors:
    robot.behavior.set_eye_color(colors[color_name])
    print(f"Eye color set to {color_name}.")
else:
    print("Invalid color name. Use 'red', 'blue', 'white', or 'pink'.")

def main():
# Prompt the user to choose a color
color = input("Enter a color (red, blue, white, pink): ").lower()

with anki_vector.Robot() as robot:
    set_eye_color(robot, color)

if name == "main":
main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant