I want to run a big c code but arduino does not have enough space. Is it possible to run a c code from a sd card?
And the file's name was gonna be "code.txt".
No
As your question does not relate to the Arduino project itself it has been moved to a more relevant forum category
no!
no.
Either get a board with more program memory (flash) or optimize your code.
Get rid of any "copy/pasted" duplicated line of code.
Use functions and arrays.
Yes, you can move the data from the SD card to memory where the processor can access it as code ABC (already been compiled), not source. However, if you’re asking whether the processor can execute code directly from the SD card, the answer is no. The instruction fetch mechanism cannot access code stored on an SD card.
No, c-code cannot be executed from a microcontroller's RAM because it must first be compiled.
The file name doesn’t matter as long as it contains the correct information and the loader places it in the appropriate location. File extensions are primarily for Windows and humans to identify file types. In Linux, the operating system will attempt to execute any file if instructed to, regardless of its extension.
For more details, check out this link: Understanding File Extensions in Linux.
- You can, sorta.
If this is still available, here is an option.
Try ESP32.
OK.
I will keep compiling my C codes and you keep running them with the C interpreter for microcontrollers of your choice.
You can run code from a text file inside an SD card, if you use a scripting language. One such option, is called Bitlash.
can arduino handle a code like this?:
NOTE: This is just an example.
if (line1 = "run"){
digitalWrite(line2, HIGH);
}
// ... and more
Line1 was the first line of the file and Line2 wans the second line of the file.
You would need to have a sketch running on the Arduino to parse the file line by line, but in principle, yes
Yes, but you'll be better off using ==, a test for equality, rather than =, an assignment operator.
a7
And don't forget to declare line1 as a String otherwise even == won't work
Ok.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.