i've been having a little tinker and play with some code, but im not sure im thinking in the right dimensions.
The intended use of the LED grid will involve individual LEDs doing various patterns dependant on the artwork that is overlaid on to the board, so I think I need to be attempting to control the LEDs in a much more individual fashion rather than by row or by column.
Is it possible to access the array in a more coordinate based style? such as being able to do something like;
So this in a grid of say 4x4, would select the LED thats the third across and third down (assuming that 0,0 would be top corner?) and set it to white.
I also have a question, having looked at the code ive currently been working with, it seems that say I wanted to update 1 LED from green to blue, I am not simply selecting that 1 LED, sending it data and then it changes. But what happens is; I update the array by adjusting 3 values within the entire array so for a 4x4 this would be adjusting 3 values in a 48 byte array, I then send out the entire array and every LED is adjusted to the new values (except that in this case only 3 have changed- so only 1 LED changes).
Im thinking that this is due to the way the LED chain operates right? And therefore not something I can change, unless I individually connect each LED to its own data pin? Will this affect the speed of the data being written if say I am adjusting the first and last LED in a 50 LED chain at the same time? would the first change noticably quicker?
I apologise if these seem like really basic questions, I tend to learn by doing and find that books often dont really help with such individual projects; although i have a java book in the post as we speak :) combined with some internet tutorials.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hey guys,
i've been having a little tinker and play with some code, but im not sure im thinking in the right dimensions.
The intended use of the LED grid will involve individual LEDs doing various patterns dependant on the artwork that is overlaid on to the board, so I think I need to be attempting to control the LEDs in a much more individual fashion rather than by row or by column.
Is it possible to access the array in a more coordinate based style? such as being able to do something like;
(2,2)
rgb [i] = 255;
rgb [i++] = 255;
rgb [i++] = 255;
So this in a grid of say 4x4, would select the LED thats the third across and third down (assuming that 0,0 would be top corner?) and set it to white.
I also have a question, having looked at the code ive currently been working with, it seems that say I wanted to update 1 LED from green to blue, I am not simply selecting that 1 LED, sending it data and then it changes. But what happens is; I update the array by adjusting 3 values within the entire array so for a 4x4 this would be adjusting 3 values in a 48 byte array, I then send out the entire array and every LED is adjusted to the new values (except that in this case only 3 have changed- so only 1 LED changes).
Im thinking that this is due to the way the LED chain operates right? And therefore not something I can change, unless I individually connect each LED to its own data pin? Will this affect the speed of the data being written if say I am adjusting the first and last LED in a 50 LED chain at the same time? would the first change noticably quicker?
I apologise if these seem like really basic questions, I tend to learn by doing and find that books often dont really help with such individual projects; although i have a java book in the post as we speak :) combined with some internet tutorials.