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.

Filter by
Sorted by
Tagged with
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
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
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 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
-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
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 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
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 vote
0 answers
137 views

I am trying to change the blue LED on my ESP8266. I can do this (sort of...) In the setupWifi() function below, there is a loop that is supposed to rapidly blink the LED while wifi is connecting. The ...
jordanthompson's user avatar
1 vote
0 answers
68 views

I have been working on a project that runs on Adafruit's Bluefruit nRF52 board. I used the SerialFlash library for Arduino provided by Paul Stoffregen: https://github.com/PaulStoffregen/SerialFlash....
Aashyk Mohaiteen's user avatar
2 votes
0 answers
193 views

I have a 3.5" TFT LCD communicating in parallel connected to Arduino UNO. I expect it draws a white circle on a black background but all it does is to show a white screen. How to fix this? main.c ...
ar2015's user avatar
  • 173
2 votes
1 answer
284 views

I realized that on the atmega boards the bootloader is programmed into the chip. I'm curious, when compiling a sketch how does the compiler/assembler differ from compiling a standard C program for a ...
FourierFlux's user avatar
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
-1 votes
1 answer
396 views

I'm pretty new to arduino. But I have some knowledge about programming in c/c++. I know that arduino is written in c. But it can't be used as normal c/c++ code. for example , instead of including some ...
dee000888's user avatar
0 votes
2 answers
156 views

Is there any way to change the TCP send buffer size (TCP_SND_BUF) on this module ? Now it is equal to TCP_SND_BUF = 2 * TCP_MSS = 2 * 1460 = 2920. Editing lwipopts.h doesn't make any difference. The ...
Vassilis Papanikolaou's user avatar
-1 votes
1 answer
115 views

I'd like to make some basic calculator. Currently, I'm struggling with inputs. I wanted to get from user some numerical input, then, I'd like to have an information, which type of calculation he is ...
user851242's user avatar
2 votes
1 answer
3k views

I have a teensy4.1, with a 16 by 2 LCD screen, and an I2C LCD interface. I was trying to write a bunch of custom characters to an LCD screen, to flip some text. my issue is that it works fine, but on ...
j0h's user avatar
  • 902
2 votes
1 answer
494 views

I have an acceleration sensor (ADXL355) that returns 20-bit data in three bytes, formatted as 2s complement : acc3 (bits 19-12) in byte register 3 (mapped to bits 7-0) acc2 (bits 11-4) in byte ...
Vassilis Papanikolaou's user avatar
5 votes
1 answer
2k views

So Let say I want to access Digital Pin 13. Thats port B pin. Is there an memory address associated with this pin 13 of Arduino Uno r3? How Port B pins are addressed with corresponding pin numbers ...
user786's user avatar
  • 155
0 votes
1 answer
87 views

So I was reading about Simple AutomaticLight Controller using LDR. or with the help of LDRSenso. But I have LM393 Photoresistor (LDR) Sensor I like to know are they same thing or somewhat different. ...
user786's user avatar
  • 155
1 vote
1 answer
189 views

Problem If the loop runs only one simulated pin and uses a filter, it will output normally (analog 1600~2200, filter 0~500), but creating an array to store multiple filtered simulated pin values will ...
C.SH.K's user avatar
  • 45
3 votes
1 answer
3k views

I'm building an arduino program on linux, using the following Makefile: ARDUINO_DIR = /usr/share/arduino BOARD_TAG = uno ARDUINO_PORT = /dev/ttyAMA0 ARDUINO_LIBS = Wire include /usr/share/arduino/...
php_nub_qq's user avatar
1 vote
1 answer
92 views

I'll start saying that I don't have much experience working with Arduino and programming in C. I have an Elegoo Arduino UNO clone. Recently I was trying to build a morse encode which converts a text ...
luigi's user avatar
  • 63
1 vote
0 answers
274 views

I am trying to simply read a voltage from a battery. I am able to work out how to do this using arduino code on an arduino board. (UNO) When I try to do the same thing on a board using python the ...
user avatar
1 vote
1 answer
573 views

I have an arduino board (SAMD21 microcontroller) which supports either Arduino or CircuitPython programming. I'd like to program in pure C/C++ instead of Arduino, which seems to be possible without ...
MendelumS's user avatar
1 vote
1 answer
2k views

I'm using FastLED library, Arduino Nano and 5 addressable LEDs (WS2812B). I'd like to create the sequence in the image attached. (all in white color for example) I know how to turn ON each LED every 0....
yuvix_man's user avatar
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
2 votes
1 answer
5k views

Hello I am new to Arduino and C programming. I wanted to parse string using sscanf fuction This is my Program String hith; int field1,field2; float field3; int F1=0,F2=0; float F3=0; int h1,h3; float ...
VISHAL M's user avatar
2 votes
2 answers
1k views

I'm using this piece of code to try to poll an IMU sensor at 100 Hz (for a AHRS sensor fusion library). void loop(void) { // nonblocking code variables static uint32_t last_ms; uint32_t ms; // ...
Zhelyazko Grudov's user avatar
-2 votes
1 answer
875 views

I know this sounds simple, but I have an Arduino Mega 2560 and I am making a matrix keypad for a claw machine. It's a 3*4 matrix keypad. Let's just say, I am making this keypad for the claw machine to ...
Austin's user avatar
  • 116
1 vote
0 answers
52 views

Sketch arduino-uno programming 1 Button and 1 Potentiometer Sketch: Each time the button is pressed, acquire the value of the potentiometer in a array of 10 positions of these values do the average ...
il king dei kings's user avatar
1 vote
1 answer
182 views

I have this code: for(int i = 0; i < its; i++) { x1 = random(0,4); y1 = random(0,4); multiLamp(new int[2] {3,1}, new int[2] {x1,x2}, new int[2] {y1,y2}, wait, 2); multiLamp(new int[...
Saha's user avatar
  • 113
2 votes
1 answer
138 views

I have a problem with my arduino buzzer: the code should be doing the following: I have a security system where in order to open the door you have to enter a 4 digit code from the remote. If the code ...
mihalca bogdan's user avatar
1 vote
0 answers
376 views

I recently switched over to Visual studio code and away from the arduino IDE though I am a novice at both. When using VSC and the neopixel library and sample code(strandtest) containing animations ...
mattr's user avatar
  • 11
0 votes
1 answer
2k views

I am trying to initialize the watchdog timer. I have installed arduino-esp32-master.zip I have #include <esp_task_wdt.h> set but it is not highlighted red indicating the IDE knows about it. ...
brad's user avatar
  • 201
2 votes
2 answers
5k views

I have written a small test code for Arduino Uno which is as follows: unsigned char tes[4]; char testing[4]; void setup() { Serial.begin(9600); for (int i = 0; i < 4; i++) { ...
Maaz Sk's user avatar
  • 345
-1 votes
1 answer
432 views

I would like to display 65k color animated gifs on my oled. I'm using the adafruit library for https://learn.adafruit.com/096-mini-color-oled Now I need to convert a significant number of images to ...
Andreas's user avatar
  • 121
0 votes
3 answers
1k views

Edit: I tried a simple code in Arduino IDE which should've done in the first place instead in doing it in a desktop compiler. Because the results are different by experiment. In the desktop C compiler,...
R1S8K's user avatar
  • 283
3 votes
2 answers
1k views

My question is quite simple: can you, somehow, upload Arduino code without closing puTTY's serial console? I hate having to close the program to open it again for reading the incoming information.
Néstor Llop's user avatar
4 votes
1 answer
1k views

I am writing (in C) some low level digit manipulation routines that convert int to float and vice versa for Arduino. I came across some puzzling behaviour with Arduino rounding some numbers but not ...
WildCat's user avatar
  • 323
1 vote
0 answers
138 views

I have a problem with my Arduino and LCD touch screen. I create a few functional button in my Arduino. One of the button is START button. Right now, I want the image is display when I touch START ...
Adam's user avatar
  • 11
3 votes
2 answers
1k views

I'm sorry for the basic question, but I have a switch case where any code placed after a certain function call simply never gets called, and I've spent half a day looking at it, so thank you so much ...
jmart's user avatar
  • 71
0 votes
1 answer
3k views

This is my structure program/ src/ Makefile main.ino test.h ... lib/ i2c.h In main.ino I include test.h and in test.h I'm trying to include i2c.h but it is just not working, I ...
php_nub_qq's user avatar
-1 votes
1 answer
276 views

I'm fairly new to arduino, and on my own I'm trying to move a servo to the left and right using 2 buttons. I've got it working for the most part, however when I hold the button down nothing happens, ...
john papp's user avatar
1 vote
1 answer
647 views

I am trying to compile the following code: logger.log_info(F(R"(some text here that may take multiple lines and here it is done.)")); But the compiler exists with the following ...
Mohammed Noureldin's user avatar
1 vote
0 answers
58 views

I want to write below code but I don't know where I doing wrong, so please help me solve this issue. Serially read some text like number then I want to serially parse integer value into some variable ...
Mehul's user avatar
  • 31
1 vote
0 answers
166 views

sim.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); I don't want to write this. I want to write mobile number on serial monitor in Arduino and on that number, i want to send message. how ...
Mehul's user avatar
  • 31
0 votes
1 answer
601 views

I'm writing the code for my Arduino board using Code::Blocks editor. When I create a new project, there is AVR Project and Arduino Project under Projects category. Which one do I select?
Nederealm's user avatar
  • 103
2 votes
1 answer
13k views

I'm trying to convert the string that I receive from the Websocket to uint8_t that I can copy to the data bytes of CAN protocol frame. I'm using an ESP32 chip and programming it on an Arduino IDE. The ...
ObviousActivity936's user avatar

1
2 3 4 5
9