Thats what im aiming to make, definately good inspiration
however i dont think it can work with libraries? not sure.
i need it to use the tft_Espi library for my device
4 posts were split to a new topic: Help me reduce the memory usage of my sketch
Have you considered CircuitPython?
i dont think circuit python can run code stored inside something like an SD card or get code from a http server and run it.
Not a good start, either. I suggest that you actually research that thought.
But here, I'll save you 30 seconds of work: Code Storage on SD Card | CircuitPython Hardware: SD Cards | Adafruit Learning System
But you are asking (for certain reasons) how to make it go on an UNO.
I think many of the issues raised here apply to the ESP32 as well, but the String stuff and your general approach mean different bad things on a not-ESP32.
a7
Hello,
I don't see how you can reduce your code half if all of it is necessary, either you remove optionnal code if their is any or you get a bigger microcontroller with more storage.
Optimisation. There may be functions that could be improved so that they output the same result as they did before but use less program space, it can be helpful to have an outside view on some code that you have been staring at for a long time.
On top of the others' replies I find it super usefule to punch in a few binutil commandsinto the command prompt to see very explicitly what's hogging memory. If you are comfortable using Microchip Studio you can then import the Arduino code there to reveal and probably delete a lot of unused "hidden" code the Arduino IDE automatically (for user simplicity) includes to further cut down the memory. Both have helped lower project memory by massive amounts
...compiler will optimise away.
a7
The most common improvement with new coders is the change from linear code handling multiple things identically but sequentially, to the concept of handling arrays of structs in loops. You can take a very long code and turn it into a very tight loop, but you have to understand the underlying process. That's one of the few instances where I've seen >50% reductions to be possible.
Sorry, but I don't believe that it is possible
It looks like you are trying to brute force an interpreter, I applaud the moxy. been there done that
The interpreter I developed referenced above will run with libraries just fine, that's actually the point of it.
I don't know if wrench is what you want, but what it would let you do is this:
Implement the library calls as API calls into wrench, which should be very straightforward I'll even help out if you want. Then simulate/stub those calls out for PC or Mac or whatever and do your development without needing hardware.
Then drop the vm with the real calls onto the actual hardware and the bytecode will 'just work'.
It would let you step through and watch your code work with a debugger in whatever environment you want, knowing it should work identically on the actual hardware, since the vm will compile onto anything.
It's very possible. It has been done quite a few times, look up and you will see this reply that shows one
Hello that sounds pretty amazing especially if it would work on Arduino Uno. I'm extremely unfamiliar with your library so I'm going to take a look at it first to see if I can understand it. I'm not sure I understand the part of implementing library calls as API calls into wrench. The library I use is tft_espi so would it go like this?: Taking the tft_espi functions and building them into your library where they could then be called by my code?
I'm completely making this up, just about to look at your library
For something with this much code, have you considered a Raspberry Pi Zero W or 2 W?
I've only had a quick look over the code, but are you really using these arrays of Strings to store numeric values? That would be a colossal waste of memory.
String strs[vs] = {"1"};
String ints[vs] = {"1"};
String chars[vs] = {"1"};
question what is circutpython
google "circuitpython"?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.