Stacking featherwings boards
Posted: Wed Jul 26, 2023 11:16 am
Hello Guys, sorry if my questions looks so much beginner.
I am trying to stack 28 feathers (ones like these https://www.adafruit.com/product/2927) using an Arduino Uno to control 56 steppers motors. The issue is that in certain point the number of objects called by the method of AdafruitMotorShield_v2 library is so big that the code is uncapable of upload due the memory error.
So, I change my perspective and start to declare these objects each interaction of a loop that change the featherwing memory each time and for that I have to change a parameter of the library from private to public (_addr variable). Now I realize that the code works but in a certain point of the loop my motors just stopped. I also try to create a method inside of the library to change this same variable, but the behavior was the same. And the reason for this, I believe is that I'm creating a lot of objects and when I achieve a certain number my Arduino is unable to continuous.
So after all of this, my question is, is there any method capable of delete the objects generated by the call of AdafruitMotorShield and Adafruit_StepperMotor classes in each loop interaction? Or any other idea how to resolve this problem?
I am trying to stack 28 feathers (ones like these https://www.adafruit.com/product/2927) using an Arduino Uno to control 56 steppers motors. The issue is that in certain point the number of objects called by the method of AdafruitMotorShield_v2 library is so big that the code is uncapable of upload due the memory error.
So, I change my perspective and start to declare these objects each interaction of a loop that change the featherwing memory each time and for that I have to change a parameter of the library from private to public (_addr variable). Now I realize that the code works but in a certain point of the loop my motors just stopped. I also try to create a method inside of the library to change this same variable, but the behavior was the same. And the reason for this, I believe is that I'm creating a lot of objects and when I achieve a certain number my Arduino is unable to continuous.
So after all of this, my question is, is there any method capable of delete the objects generated by the call of AdafruitMotorShield and Adafruit_StepperMotor classes in each loop interaction? Or any other idea how to resolve this problem?