Notifications
Clear all
Topic starter
2024-09-02 11:54 pm
#include "LivinGrimoireLight.h" Chobit* c1 = new Chobit(); // global var void setup() { Led led1(6); // used to initialize the Hello World skill Skill* s2 = new DiHelloWorld(led1); // example skill created Skill* s3 = new DiTemperature(0); // LM35 connected to analog pin #0 c1->addSkill(s2); c1->addSkill(s3); } void loop() { c1->think(0, 0, 0); }
^ example of 2 skills added and used. a led blink skill and a temperature read skill.
note the void method only has 1 line of code now
this way the Arduino/Elegoo skills are capsulated.
less code in the void method.
I can swap skills instead of tinker with code
avoid code debt.
can collaborate using skills other people made
as Terry A Davis said: "I want my code to be beautiful not just functional"
Team Fuki
2024-09-04 5:18 pm
Add checks or error handling if skills fail to initialize or execute.