Hi fellow Nybble and Bittle owners !
I introduce myself, my name is Flavien, I live in France and I'm actually student at 42school in Paris, a coding school.
I adopted a cute Bittle (I named him Scotty 😍) not long ago and I started to look at the opencat code, there not so documentation about the code for the moment so for helping people understand and customise her awesome robot friend I will post here some early analysis of the code, you can ask me some questions about the code here too, I will try to answer as best as possible. In this first post I will explain the main files structure.
The code is divided in 5 "main" files (without counting module test programs). At the root is located OpenCat.ino, this is the main code of your robot, it contains all the starting setup code and the main loop that brings your robot to life. In the WriteInstict folder are located the two instinct header files (InstinctBittle.h for Bittle, InstinctNybble.h for Nybble... pretty self-explaining). Here are located the data about the movements known by your robot, the usage of its two files is documented here: https://bittle.petoi.com/8-teach-bittle-new-skills#8-1-understand-skills-in-instinctbittle-h. In this folder is also located WriteInstrict.ino, the program is used to write the instincts located in the instinct headers in the eeprom (internal memory where is stored the instincts data, among others things) as well as to calibrate the gyro sensor and the offsets for the servos, this program is also well documented in the calibration section of the documentation: https://bittle.petoi.com/6-calibration. The last file in this folder is OpenCat.h, this header file contains a lot of functions used by the OpenCat.ino file, you can see it as the library of OpenCat, it contains functions to use the buzzer, get information from the remote and serial port, write and read from the eeprom or more essential all the functions related to motion and execution of the instincts data.
So if you want customise your robot you will use 3 files:
- mainly the instinct header to learn new tricks to your robot.
- secondly the OpenCat header for his utilities functions.
- thirdly the OpenCat.ino file but only if you want to modify more deeply the functionality of your robot. That's all for the moment ! I will explain more deeply some files in future posts. Have fun with your robot friend !
Hi Flavien! Greetings from the Netherlands! Thanks, I think it's a good idea. Keep on posting! I agree with Rongzhong that having structured subjects of those posts will help us to go through them.
Thanks for your explanations of the code. I'll move your post to the software category.
Suggestion: if you are going to post in series, it's better to name them with a common header, like
Code Analysis: main structure
Code Analysis: XXXX
Flavien's Review on OpenCat Code: main structure
Flavien's Review on OpenCat Code: blahblah...