PetoiCamp / OpenCat

An open source quadruped robot pet framework for developing Boston Dynamics-style four-legged robots that are perfect for STEM, coding & robotics education, IoT robotics applications, AI-enhanced robotics application services, research, and DIY robotics kit development.
https://www.petoi.com
MIT License
3.65k stars 443 forks source link

Use gyro and ultrasonic eyes #93

Open josephburnett opened 2 months ago

josephburnett commented 2 months ago

Currently the software cannot use the gyro and ultrasonic eyes at the same time.

https://github.com/PetoiCamp/OpenCat/blob/902c3192224833202c429f59df9678b60d838989/OpenCat.ino#L55

Is this a software limitation (making the compiled code smaller) or a hardware limitation (not enough registers)? I am interested in improving the code to have both working at the same time.

borntoleave commented 2 months ago

ATmega328P only has 32 KB flash and 2 KB SRAM. The added features and UI eventually filled up the programming space (Flash), making it difficult to run two large modules simultaneously. The 64Kb I2C EEPROM used for saving behaviors data is also filled up. You can comment out the IR_PIN and disable the Neopixels in the Ultrasonic sensor to save space for the Gyro.

We are moving to OpenCatESP32, where the computational resources are more abundant.