Skip to main content

Questions tagged [programming]

The process of designing and writing source code as part of a program (or sketch) for Arduino. For questions about uploading code to an Arduino board, use the [uploading] tag instead.

135 votes
4 answers
121k views

I need to read a sensor every five minutes, but since my sketch also has other tasks to do, I cannot just delay() between the readings. There is the Blink without delay tutorial suggesting I code ...
Edgar Bonet's user avatar
  • 45.2k
94 votes
22 answers
19k views

The basic Arduino IDE lacks a lot of the sophistication present in other IDEs such as code completion, code collapsing, folder organisation, etc. Are there other IDEs that allow programming in C or C++...
DLJ's user avatar
  • 1,149
64 votes
7 answers
112k views

The use of malloc() and free() seems pretty rare in the Arduino world. It is used in pure AVR C much more often, but still with caution. Is it a really bad idea to use malloc() and free() with ...
Cybergibbons's user avatar
  • 5,430
41 votes
10 answers
160k views

I have a Arduino Nano (Sainsmart) that I'm trying to upload a sketch to. Under the Arduino IDE, the device selected was Arduino Nano w/ ATmega328. However uploading the sketch gives me the error ...
Nyxynyx's user avatar
  • 1,419
41 votes
10 answers
178k views

I am not very skilled with the C Language and I was wondering if there is a way in which python could be used to program an Arduino. This would most likely require a different IDE in order to be able ...
JVarhol's user avatar
  • 1,903
32 votes
4 answers
60k views

Arduino is an odd hybrid, where some C++ functionality is used in the embedded world—traditionally a C environment. Indeed, a lot of Arduino code is very C like though. C has traditionally used #...
Cybergibbons's user avatar
  • 5,430
24 votes
3 answers
58k views

In an Arduino sketch, is there a way to make asynchronous function calls within the loop? Like listening to requests through http server and process them in a non-blocking way.
Jacer Omri's user avatar
23 votes
2 answers
19k views

I wanted to move some of my code out into a second tab in the Arduino IDE, to keep things better organised. At first, I only tried moving a function, and it seemed to work fine. I could call the ...
Peter Bloomfield's user avatar
22 votes
5 answers
79k views

C on embedded systems has traditionally use structs to hold structured data. Arduino brings C++ to the table, so we can use classes instead. Lets say we have two different data structures which ...
Cybergibbons's user avatar
  • 5,430
22 votes
5 answers
8k views

The Arduino Uno board has limited RAM which means it has a limited call stack available. Sometimes, recursion is the only quick option to implement a certain algorithm. So, given that the call stack ...
asheeshr's user avatar
  • 3,847
21 votes
3 answers
9k views

I have no previous experience with C++ or C, but know how to program C# and am learning Arduino. I just want to organize my sketches and am quite comfortable with the Arduino language even with its ...
heltonbiker's user avatar
21 votes
2 answers
13k views

When you're writing a typical sketch, you usually rely on loop() being called repeatedly for as long as the Arduino is running. Moving in and out of the loop() function must introduce a small overhead ...
Peter Bloomfield's user avatar
19 votes
5 answers
80k views

What does this error means? I can't solve it in any way. warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
Facorazza's user avatar
  • 439
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
18 votes
3 answers
11k views

I want to unit test my Arduino code. Ideally, I want to execute and test my code without uploading it to the board. What tools or libraries can help me with this? There is an Arduino emulator in ...
Hardik Thaker's user avatar

15 30 50 per page
1
2 3 4 5
112