Skip to main content
Spelling, grammar and removal of profanity
Source Link
Code Gorilla
  • 5.7k
  • 1
  • 17
  • 31

Keep in mind that RAM is even less. 32KB is a fair lot of code, since C/C++ is highly efficient. "Don't save shit**** in RAM."

If you need to load images into a display, save the images on an SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or something.

Also, if you need long strings, you can use the "flashStringHelper" to store the string in flash memory. For example: println(F(”Error message: Couldn't connect to server));. By using F() around the string, you save valuable bytes.

Not using Arduino code, but pure AVR-C/C++, can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know how it works. The Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

Keep in mind that your saving technique depends on what resources are low. If you need to do a lot simultaneously, it's better to write non-blocking code.

But also remember: Don't optimize unless it's actually needed! Or, actually set measurable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.

Keep in mind that RAM is even less. 32KB is a fair lot of code, since C/C++ is highly efficient. "Don't save shit in RAM."

If you need to load images into a display, save the images on an SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or something.

Also, if you need long strings, you can use the "flashStringHelper" to store the string in flash memory. For example: println(F(”Error message: Couldn't connect to server));. By using F() around the string, you save valuable bytes.

Not using Arduino code, but pure AVR-C/C++, can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know how it works. The Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

Keep in mind that your saving technique depends on what resources are low. If you need to do a lot simultaneously, it's better to write non-blocking code.

But also remember: Don't optimize unless it's actually needed! Or, actually set measurable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.

Keep in mind that RAM is even less. 32KB is a fair lot of code, since C/C++ is highly efficient. "Don't save **** in RAM."

If you need to load images into a display, save the images on an SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or something.

Also, if you need long strings, you can use the "flashStringHelper" to store the string in flash memory. For example: println(F(”Error message: Couldn't connect to server));. By using F() around the string, you save valuable bytes.

Not using Arduino code, but pure AVR-C/C++, can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know how it works. The Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

Keep in mind that your saving technique depends on what resources are low. If you need to do a lot simultaneously, it's better to write non-blocking code.

But also remember: Don't optimize unless it's actually needed! Or, actually set measurable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.

MindKeep in mind that RAM is even less. 32kB32KB is a fair lot of code, since C/C++ is highly efficiëntefficient. "Don't "Don't save shit in RAM."

If you need to load images into ana display, save the images on aan SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or smhsomething.

Also, if you need long strings, you vancan use the "flashStringHelper" to store the string in flash memory. For example: 'println(F(”Error message: Couldn't connect to server));' , byprintln(F(”Error message: Couldn't connect to server));. By using "F()”F() around the string, you save valuable bytes.

notNot using Arduino code, but pure AVR-C/C++, can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know hoehow it works, the. The Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

MindKeep in mind that your saving technique depends on what resources are low. If you need to do a lot simultaniouslysimultaneously, it's better to write non-blocking code.

But also mindremember: Don't optimize unless it's actually needed! Or, actually set measureablemeasurable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.

Mind that RAM is even less. 32kB is a fair lot of code, since C/C++ is highly efficiënt. "Don't save shit in RAM."

If you need to load images into an display, save the images on a SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or smh.

Also, if you need long strings, you van use the "flashStringHelper" to store the string in flash memory. For example: 'println(F(”Error message: Couldn't connect to server));' , by using "F()” around the string, you save valuable bytes.

not using Arduino code, but pure AVR-C/C++ can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know hoe it works, the Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

Mind that your saving technique depends on what resources are low. If you need to do a lot simultaniously, it's better to write non-blocking code.

But also mind: Don't optimize unless it's actually needed! Or, actually set measureable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.

Keep in mind that RAM is even less. 32KB is a fair lot of code, since C/C++ is highly efficient. "Don't save shit in RAM."

If you need to load images into a display, save the images on an SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or something.

Also, if you need long strings, you can use the "flashStringHelper" to store the string in flash memory. For example: println(F(”Error message: Couldn't connect to server));. By using F() around the string, you save valuable bytes.

Not using Arduino code, but pure AVR-C/C++, can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know how it works. The Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

Keep in mind that your saving technique depends on what resources are low. If you need to do a lot simultaneously, it's better to write non-blocking code.

But also remember: Don't optimize unless it's actually needed! Or, actually set measurable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.

Source Link
aaa
  • 2.7k
  • 2
  • 25
  • 40

Mind that RAM is even less. 32kB is a fair lot of code, since C/C++ is highly efficiënt. "Don't save shit in RAM."

If you need to load images into an display, save the images on a SD card. And "stream" it to the display. You can read and transmit the bytes one by one, or 10 by 10 or smh.

Also, if you need long strings, you van use the "flashStringHelper" to store the string in flash memory. For example: 'println(F(”Error message: Couldn't connect to server));' , by using "F()” around the string, you save valuable bytes.

not using Arduino code, but pure AVR-C/C++ can save you a little also. (Will also save the bootloader piece of memory, if you program directly with a programmer.)

If you use Arduino, know hoe it works, the Arduino serial library uses ~256 or 500 bytes (I believe) as a buffer. You can change this if you need it for other applications.

Mind that your saving technique depends on what resources are low. If you need to do a lot simultaniously, it's better to write non-blocking code.

But also mind: Don't optimize unless it's actually needed! Or, actually set measureable and realistic requirements, optimizing something to be "as fast as possible" can take infinite amounts of time... Run a google search on "premature optimization" as the old folks in the field like to call it.