1 of 2

Animals

AI Lesson 3: Picky Eater

Train your puppy to recognize and respond to different colored “foods”.

Machine Learning Method:

3D K-Nearest Neighbor

Tools:

Color sensor, special code class “Lesson3Training

EXAMPLE IDEAS

Made by:

Natalie Sheehan

v02.05.2024

AI

Advanced

Build a puppy that can react in at least two different ways

Flip over for more details!

2 of 2

CODE IT!

BUILD IT!

Modify It

  • Define functions for any reactions you want your puppy to have when seeing different colors
  • Read through the provided class and use the other defined functions to write the rest of your code
  • Try out different colors, some are easier for the code to differentiate than others

Sample code for reacting to colors:

CHALLENGE YOURSELF

How many colors can your puppy successfully recognize?

Can you add additional reactions for more than two colors?

Attach the color sensor in a location so that it can easily “see” an object held in front of the puppy

Make sure the left, center, and right hub buttons are easily accessible