Hi,
I'm working on the code of an installation that uses a teensy 3.1 with OctoWS2811 to control leds.
Here is a bit of an old video of the installation to get an idea: https://www.youtube.com/watch?v=0KjQS3GsGWQ
This "Creative Mind" artistically represents a neural network with the spheres being neurons and the tubes being synapses.
I'm now trying to get the code to be more structured by making a library and using classes, for example every ledstrip in a neuron or synapse is defined by the "Segment" class.
Now, i ran into a problem that got me stuck for a couple of days.
I'm trying to add more variables to the "Segment" class, but up to now this always results in the system to behave unexpectedly and freeze after some seconds.
This happens already when I only add an int to the list of variables.
I know this sounds like too much memory is being used and data therefore is getting corrupted, but after compiling it says only 15% of the program memory and 48% of the dynamic memory is being used.
No dynamic memory allocation is done as far as I know; I don't use malloc. When I print the amount of free ram in the program itself it stays around 33588 bytes.
When I reduced the amount of instances of the Segment class from 75 to 10 it still happened.
So it seems to me the problem is not caused by a lack of free memory space, but more because of some kind of limit on the size a class can have or something...
I hope somebody could at least help me to look in the right direction, because I really don't know how to solve this.
I'm using Arduino 1.6.5 and teensyduino 1.25 on Windows 10.
The code can be found here: https://github.com/emielch/Colore
The sketch I'm working on is called CMControllerNXT and can be found in the examples.
I'm working on the code of an installation that uses a teensy 3.1 with OctoWS2811 to control leds.
Here is a bit of an old video of the installation to get an idea: https://www.youtube.com/watch?v=0KjQS3GsGWQ
This "Creative Mind" artistically represents a neural network with the spheres being neurons and the tubes being synapses.
I'm now trying to get the code to be more structured by making a library and using classes, for example every ledstrip in a neuron or synapse is defined by the "Segment" class.
Now, i ran into a problem that got me stuck for a couple of days.
I'm trying to add more variables to the "Segment" class, but up to now this always results in the system to behave unexpectedly and freeze after some seconds.
This happens already when I only add an int to the list of variables.
I know this sounds like too much memory is being used and data therefore is getting corrupted, but after compiling it says only 15% of the program memory and 48% of the dynamic memory is being used.
No dynamic memory allocation is done as far as I know; I don't use malloc. When I print the amount of free ram in the program itself it stays around 33588 bytes.
When I reduced the amount of instances of the Segment class from 75 to 10 it still happened.
So it seems to me the problem is not caused by a lack of free memory space, but more because of some kind of limit on the size a class can have or something...
I hope somebody could at least help me to look in the right direction, because I really don't know how to solve this.
I'm using Arduino 1.6.5 and teensyduino 1.25 on Windows 10.
The code can be found here: https://github.com/emielch/Colore
The sketch I'm working on is called CMControllerNXT and can be found in the examples.