You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Set the eye color if it exists
if color_name in colors:
r, g, b = colors[color_name]
robot.set_center_led_color(cozmo.lights.Color(rgb=(r, g, b)))
print(f"Eye color set to {color_name}.")
else:
print("Invalid color name. Use 'green', 'red', or 'pink'.")
def cozmo_program(robot: cozmo.robot.Robot):
# Prompt user to choose a color
color = input("Enter a color (green, red, pink): ").lower()
set_eye_color(robot, color)
cozmo.run_program(cozmo_program)
The text was updated successfully, but these errors were encountered:
Readyornot69
changed the title
The eye change code for anki cozmo
The eye change code for anki cozmo (you need the cozmo sdk)
Dec 29, 2024
import cozmo
from cozmo.util import degrees
def set_eye_color(robot: cozmo.robot.Robot, color_name: str):
# Define RGB values for the colors
colors = {
"green": (0, 255, 0),
"red": (255, 0, 0),
"pink": (255, 105, 180)
}
def cozmo_program(robot: cozmo.robot.Robot):
# Prompt user to choose a color
color = input("Enter a color (green, red, pink): ").lower()
set_eye_color(robot, color)
cozmo.run_program(cozmo_program)
The text was updated successfully, but these errors were encountered: