Two Nybbles (SP0T and L0R) hang out in my living room. Each is running @Gero 's ultrasonic sensor implementation and python automation script. The script executes automatically on boot, so each cat is self contained – I just switch em' on and set them loose.
It'd be super interesting to give the cats an awareness of each other and develop shared behaviors. This is a bit beyond my novice coding abilities, but I'm eager to experiment. For now, these two anxiously await their Bittle bro!
I'm curious about what would happen if they face each other. The ultrasonic sensor signals will interfere each other, making the distance measurement chaotic.
@Rongzhong Li You made me curious too. I assumed the sensors would interfere with each other, but they don't! I was surprised to see the cats read each other as objects, and react accordingly. Check it out:
I thought I'd see something interesting in the serial monitors, but they're like rocks to each other. Indeed, they seem to "see" each other better when the sensors are aligned. Now I'm curious as to why this is!
Edit: after some research I’ve learned the sensors *can* interfere with each other if in sync. Apparently the timing on mine are sufficiently different. More cats/sensors will increase the chance for problems, but these two seem fine.
@D_C_E I guess the update interval of 500 ms gives enough space so they don‘t interfere. Once you increase the update frequency the chance of interference will be higher.