Skip to main content

Questions tagged [c]

C is a procedural programming language which is widely used in embedded systems. PLEASE NOTE: Arduino is typically programmed in C++, not C.

0 votes
1 answer
130 views

I want to serialise and deserialise a struct containing a flexible array. I did find a working code but wondering if it is the most elegant and optimum way to do it. This is my first attempt below ...
Noel's user avatar
  • 163
0 votes
2 answers
83 views

I'm working on a ball-counting project using two IR sensors to detect balls entering and exiting a room, but I'm currently stuck. I need help refining the logic in my while loop. Here's how I want it ...
cerouno's user avatar
  • 11
12 votes
6 answers
5k views

I've been reading a lot over the years why we should not use the notorious String class and how heap fragmentation is bad practice and not professional and we should never use it in our programs or we'...
Nino's user avatar
  • 411
0 votes
1 answer
122 views

I am working on a custom SD card data logger using the following function and struct: char *filenameCreator(const char *prefix, const char *num, bool addExtension) { char *filename = (char *)...
Daniel Melendrez's user avatar
2 votes
2 answers
6k views

Currently i have a project that forced me to make a program that receives several data from Serial Input using Interrupt in Arduino. I use Arduino as the receiver and ESP32 as the sender through ...
Zero's user avatar
  • 21
-1 votes
1 answer
363 views

So I have: 1/ My myapp.ino file, that includes src.h (implemented in src.cpp). Compiled for Arduino Uno. 2/ I also have a unit-tests.cpp file that is meant to test functions in src.cpp. Compiled for ...
theredled's user avatar
4 votes
1 answer
697 views

The idea was to create a bluetooth device on the arduino to read data from the machine (ELM327 v2.1) using the HC-05 bluetooth module. In this code the bluetooth module is switched to MASTER mode and ...
gfd2's user avatar
  • 141
-1 votes
1 answer
561 views

I have a project where I need to store data (~16 Mo) on a memory and be able to fetch the data fast (<36000 bits/s) with DMA because I have other signals to take care of. Currently I use an SD card ...
Vlad's user avatar
  • 49
0 votes
1 answer
95 views

i am working on a atmega328p, learning to uses its registers instead a coding with common arduino code. i've found this formula to get the baud rate on the Serial port (using USART protocol) : how ...
gowb0w's user avatar
  • 3
1 vote
2 answers
510 views

I'm trying to use pulseIn with elapsed time using millis(), I don't want to use interrupts instead of pulseIn (I need pulseIn because I need accurate pulse time), the elapsed time doesn't need to be ...
Takata's user avatar
  • 89
0 votes
4 answers
1k views

When I need to send multiple bytes via Wire, for example a long int, I cast it to a byte array and specify a length long int i; Wire.write((byte*)&i, 4); But if I want to send bytes from more ...
user88434's user avatar
4 votes
5 answers
18k views

I would like to convert a byte *payload to a String, because I want to compare the content of payload to another String. void mqttCallbackHandler(char *topic, byte *payload, unsigned int length) { ...
Dániel Kis's user avatar
16 votes
6 answers
21k views

I want to write a sketch that can be compiled on different Arduino boards. I want to display on the PC which board is currently connected. This means that the user connects the PC via USB cable to ...
Elmue's user avatar
  • 481
7 votes
3 answers
52k views

I updated and uploaded some code on another computer that got wiped and didn't send the new code to my current computer, the updated code is still on the board but I don't have access to it. How do I ...
Awesome_Ace22's user avatar
9 votes
2 answers
8k views

I use the interrupt function to fill an array with values received from digitalRead(). void setup() { Serial.begin(115200); attachInterrupt(0, test_func, CHANGE); } void test_func() { if (...
user277820's user avatar

15 30 50 per page
1
2 3 4 5
29