All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
53 views

Modular Coding - What types of code portions to convert into library files? Rationale and methods?

I'm working on documentation and combining 2 pieces of code for testing parts of a larger project. I'm supposed to comment and make the code very clear to people who will use it later and make sure ...
-1
votes
1answer
71 views

Refactoring bad design?

Could someone help me how to refactor old very complex code ? Original used just setup and everything else was in single ISR. But as it was bigger and bigger, code is quite slow and quite random ...
7
votes
2answers
542 views

Storage usage of methods compared to copied code

When you have really small snippets of code that are repeated several times in your micro controller program, is it better to write a method? I mean better in terms of performance and storage usage. I ...
0
votes
1answer
398 views

Switch Statement Alternative

I am working on a project where I've mapped an IR remote control to certain functions. I am currently using a massive switch statement to control the program based on the IR remote button pressed. Is ...
3
votes
1answer
1k views

OOP vs procedural programming on arduino

It seems like the majority of Arduino applications are written without using classes / objects. Is there a reason for this? Does is slow down the Arduino or somehow present undesirable behavior?
0
votes
2answers
62 views

Interrupt numbering

I'm using an Arduino Mega and four of its interrupts. Each interrupt is only used to start/stop a timer, depending if it's rising or falling, so effectively runs the same function. Does anyone know if ...
-3
votes
1answer
135 views

How do I learn C? (was Computer project) [closed]

Can you help me writing a code for this question guys?? You have an Arduino Uno with 8 LEDs connected to digital pins 2 to 9. Create an array of 8 elements. Fill it with random numbers between 2 and 9 ...
0
votes
1answer
83 views

Sweep with two shift registers

I am working with 8 dual color LED's and 2 shift registers. My connections are in place. But I do not understand how to work with 2 shift registers. So I am trying to make this: turn the first led on,...
0
votes
2answers
388 views

releasing memory in sub-function

I'm doing a program who get a line from the SD and shows it, this function is called getData() FULL CODE: #include <SD.h> #include <MemoryFree.h> File myFile; int stringIndex = 0; int ...
18
votes
4answers
130k views

How can I declare an array of variable size (Globally)

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 ...