I've got a textbox displaying the sketch edited by the software, with variables being changed dynamically.
https://cdn.discordapp.com/attachments/398780553731506176/468835565304020995/unknown.png
But for the buttons array, I need to use some for loops to write the numbers
The format needs to be like this
byte buttons[NUMROWS][NUMCOLS] = {
{0,1,2,3,4,},
{5,6,7,8,9,},
{10,11,12,13,14,},
But all I can manage so far is
byte buttons[NUMROWS][NUMCOLS] = {
{0,1,2,3,4,},
{1,2,3,4,5,},
{2,3,4,5,6,},
I need to advance the loop so that the numbers increase. I'm using two nested for loops
int i;
for(int x = 0; x < rows; x++) //row
{
string buttonbyte = "{";
for (i = x; i < columns + x; i++) //column
{
buttonbyte += i;
buttonbyte += ",";
}
sketch[9 + x] = buttonbyte + "},";
}
The code is for a program that edits an arduino .ide sketch and uploads it, for ease of use.
Any help would be greatly appreciated!
Cheers, Morgan