Skip to main content

Questions tagged [code-optimization]

The process of improving the efficiency of a program such that is uses less memory and/or less computational time.

3 votes
2 answers
1k views

I feel a little like I am back in 1975 trying to fit my code in 4K of RAM. I am writing some code for an ATTiny88, and the code is starting to get big, relatively speaking. I need to save every byte ...
LesRhorer's user avatar
  • 113
2 votes
2 answers
2k views

Background I'm reading a 24-bit ADC value into a uint32. Using SPI bus, here's the logic: value = SPI.transfer(0); // read first 8 bits (MSB first) value <<= 8; // shift ...
hazymat's user avatar
  • 121
1 vote
0 answers
61 views

Please let me know if this post has the wrong tags, I will make sure to change it. My goal is to get the highest sampling rate possible from the Adafruit LSM6DSOX (6667Hz) using the Arduino MKR WIFI ...
infinite_yeet's user avatar
7 votes
4 answers
1k views

I'm trying to squeeze code onto an ATtiny10, but I'm just not getting there. I'm using 1060 bytes and only have space for 1024 bytes. The code is simple enough; I need to read a button pin. If high it ...
Earthbound Ruben's user avatar
-2 votes
1 answer
701 views

I am new to programming and am trying to create an array of 10 thermistors on one arduino. So far I have found a code for Temperature Sensor Using NTC Thermistor that is only for one thermistor. How ...
Jen's user avatar
  • 1
1 vote
1 answer
286 views

I want to check for specific string (like "RecordStart") in a UART stream (115 200 baud 8N1) from a camera, to know when it is recording or not/if there is an SD. I am using an ESP32-WROOM-...
AyubowanPro's user avatar
0 votes
2 answers
478 views

I'm working on a little midi hardware project and I'm using attachInterrupt() to assign a callback function to an interrupt pin. Nothing gets done in the loop function, so it looks like this: void ...
strudelkopf's user avatar
8 votes
4 answers
4k views

While doing big projects using Arduino boards (Uno, Atmega328P MCU). I used to get warnings like this Sketch uses 13764 bytes (44%) of program storage space. Maximum is 30720 bytes. Global variables ...
Mayoogh Girish's user avatar
-1 votes
3 answers
359 views

I am actually wondering if there's a way to efficiently do this block of code. There are two things in my specifications and these are: Four IR Sensors that detects blockage. Basically just to ...
fireblazer10's user avatar
4 votes
2 answers
2k views

Im trying to move a servo from one place to another while using the typical for loop you find in the servo's library example: int lightON = 180; int lightOFF = 90; for (pos1 = lightOFF; pos1 <= ...
Marcelo_M's user avatar
  • 121
4 votes
2 answers
413 views

I'm working on a project with a Digispark ATTiny85, that performs keystrokes using the DigisparkKeyboard library (https://github.com/digistump/DigisparkArduinoIntegration/tree/master/libraries/...
emma.makes's user avatar
5 votes
3 answers
4k views

I have been working on an arduino program, which has gotten rather large. I am close to hitting the 32k limit on Flash for my ATmega328p. I would like lower my program size by saving some of my many ...
riverrun's user avatar
19 votes
5 answers
191k views

I'd like to make three arrays of the same length. According to the documentation, Arrays must be defined as int myArray[10]; where 10 can be substituted for a known length (another integer), or filled ...
user3.1415927's user avatar
1 vote
3 answers
2k views

I am looking for a way to create a true analog output with the arduino uno. I am constantly reading an analog input on a0 pin, all i want to do is send the same signal as output. I know arduino ...
eToll Systems's user avatar
0 votes
1 answer
2k views

I'm trying to build arduino nonce generator, but the only thing I found is this question on arduino forum but I can't find out how to make it work for me. I checked and Serial.available() is always 0 ...
krystof18's user avatar
  • 315

15 30 50 per page
1
2 3 4 5
9