Phil Sznyck
Member
Hi, I'm a bit clueless at how the problem I have occurs. I'll tell something about the idea and then I'll come to the problem:
I'm building a midi footcontroller with a big display full of information. To be able to freely configure the controller without a computer I've decided to store lots of variables on a SD card.
I have an array of strings (words like "play", "drum 1" and so on). In this array there are also some spaces: " " so the teensy compares if at this position of the array is a word or not. If there is only " " (six space bars) instead of a word the display shows the command of a button in a bank (like CC 74). This worked fantastic until the moment I copied the string array to the SD card, emptied the array in the code and then written the string array back from the SD to the teensy. Everything works good EXCEPT the comparison of strings. So I know for sure that the data has been written to the teensy. The teensy is constantly comparing data and has no problem comparing integers, but even if I write "empty" instead of " " and therefore have a word written there it won't recognise it as "empty".
The code is much to large to be shared here, so I'll write the lines of code I'm using to write to the SD and the ones for writing back and the ones to compare values:
<script src="https://pastebin.com/embed_js/T1RSpTcj"></script>
Maybe its a known thing, and I could add another array to tell if the pedal should take the name from the string array or not, but somehow I think this should work without 181 more variables, cause it did work so without the SD card in the middle...
Well, maybe someone can help... thanks in advance!
I'm building a midi footcontroller with a big display full of information. To be able to freely configure the controller without a computer I've decided to store lots of variables on a SD card.
I have an array of strings (words like "play", "drum 1" and so on). In this array there are also some spaces: " " so the teensy compares if at this position of the array is a word or not. If there is only " " (six space bars) instead of a word the display shows the command of a button in a bank (like CC 74). This worked fantastic until the moment I copied the string array to the SD card, emptied the array in the code and then written the string array back from the SD to the teensy. Everything works good EXCEPT the comparison of strings. So I know for sure that the data has been written to the teensy. The teensy is constantly comparing data and has no problem comparing integers, but even if I write "empty" instead of " " and therefore have a word written there it won't recognise it as "empty".
The code is much to large to be shared here, so I'll write the lines of code I'm using to write to the SD and the ones for writing back and the ones to compare values:
<script src="https://pastebin.com/embed_js/T1RSpTcj"></script>
Maybe its a known thing, and I could add another array to tell if the pedal should take the name from the string array or not, but somehow I think this should work without 181 more variables, cause it did work so without the SD card in the middle...
Well, maybe someone can help... thanks in advance!