1. System diagram
Cats love to chase a moving thing even it is not a bird of a mouse. For this characteristic, there are some apps to catch a goldfish or mice for cats. And they love to play with them.
I do love cats, do love playing with cats, so wanted to give them more playful toy with physical interactions.
Cats love to sit on a laptop. Maybe because it is warm? We do not know the reason exactly but they love to sit there and distract us when we do our work with a laptop.
In addition, cats are interested in the moving things on a screen. Even there is a lot of videos for cats on Youtube.
So, why not making a toy with a laptop screen?
It would be combination of p5js and physical computing. When a cat put his legs on a sensor, it might be a piezo or a pressure sensor, a bird or a mice will be shown up a screen. Moreover, some sensor will be connected to a camera on a laptop, so a cat could see his or her face.
I set three digital outputs, a green LED, a yellow LED and a motor, separately. The result was they were turned on in order of writing codes.
So, I put two LEDs in a same digital output and they were turned on at the same time as I expected.
I changed the delay time shorter to allow LEDs to blink faster.
I practiced variables which are mouseX, mouseY and mouseClick. I run into a lot of problems and could not make this as much as I wanted.
I put comments my questions in codes and hope to figure them out soon.