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.

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

Stepper motor is only moving one step at a time with an IR sensor

I am trying to get both the motors to run simultaneously once the motion detector senses an obstacle. Both motors run fine by themselves but when I implement the sensor the motors only move one step ...
-1
votes
0answers
30 views

How to create a Pll using arduino uno? [closed]

I have a project which needs A PLL controled by arduino uno to manipulate the phase si please help me !!!!
0
votes
1answer
19 views

How to find the peak value of analog signal?

I have a question .. Please help me I don't know how Arduino can read the peak value of the sensor signal. The value I want is in the ADC value .. What I want is ... for 5 seconds there will be 1 ...
-2
votes
0answers
34 views

void setup () } expected primary-expression before 'void' [closed]

const int VAL_PROBE = 0; // Analog pin 0 const int MOISTURE_LEVEL = 900; /* the value after the LED goes ON */ void setup() { Serial.begin(9600); } void LedState(int state) { digitalWrite(12, state);...
0
votes
1answer
43 views

How to use any module that has no library for arduino?

I am 2 years old in this Arduino world. I am currently working on a project where I am about to make use of a fingerprint sensor. Now my question is that could we be able to make use of a sensor that ...
0
votes
0answers
14 views

How to take input to the system using a GSM module [closed]

Hey I want to take the received sms to the GSM module as an input and respond to it.My project aim is to find whether the person is safe or not .So to know the response of the person what I need to ...
-1
votes
0answers
29 views

Why does this function get stuck?

I want to read some data from another Arduino using I2C. I wrote this function for it: float s; byte buf[4]; float requestSpeed(unsigned int id){ Wire.beginTransmission(1); Wire.write(...
5
votes
2answers
2k views

Can we burn Arduino bootloader into any microcontroller chip?

I am new to this Arduino community I noticed on youtube that while the prototype is complete people purchase new ATmega328p chips and flash bootloaders into them using in-system-programmers so that ...
0
votes
0answers
13 views

Cross correlation in Arduino [closed]

For a project we are trying to cross-correlate two signals to try to find the maximum correlation value. Brief information of the two signals: one signal is of a laser operating at 1.3 kHz operating ...
0
votes
1answer
75 views

How to have 4 Arduinos communicate with each other? [closed]

I was wondering if it was possible to connect 4 Arduinos together so that the sensors input can be received by all 4 of them either by a wired connection or a wireless connection either way it should ...
0
votes
0answers
32 views

How to edit code from Node-Red to Cayenne

I am working on a project to run some (relays or LED's) on an inputs (Pins) Arduino by esp8266-01s . now while searching on internet I found a video divided it two step that talks about the issue ...
0
votes
1answer
95 views

Serial Monitor presenting backwards question marks

Thanks to anybody who can offer some guidance on this issue . I would like to quickly point out that the microcontrollers being used are OrangePip Kona 328. When I put the light on the photodiode ( ...
-2
votes
0answers
39 views

Must include empty print statement to get program to run

I have a rather large program of the following shape: loop forever while some condition run each program in list by calling the program's 'run()' function end while end loop I'm running it ...
1
vote
1answer
39 views

Reduce Sketch Size Help!

I dont know what to do? Sketch uses 3712 bytes (12%) of program storage space. Maximum is 30720 bytes. Global variables use 210 bytes (10%) of dynamic memory, leaving 1838 bytes for local variables. ...
0
votes
0answers
31 views

HX711 Arduino library creation

I'm trying to create my own library for HX711. In that, I created a .h file and a .cpp file. There are some issues in my program. Please tell me what the error in the code is. hx711adc.h file-> #...
1
vote
1answer
53 views

I want turn the led off only when the input is low for a prolonged period of time and not when there are ups and downs in sound signal [closed]

My project is baby cry detection,when the baby cries the led must turn on and when it stops it should turn off, but I want it to turn off only when the baby has stopped crying , not when there are ups ...
0
votes
2answers
43 views

Is possible use Macro F() with Integer and Other types of variable?

i have a sketch that is using very memory RAM of my Atmega2560 (is a giant project), and i need use various "println" because i have a TFT screen and i need to show data on the screen to user see. So, ...
0
votes
0answers
19 views

Atmega168A won't be programmed via USB (Minicore) [duplicate]

I have designed a custom board based on a Atmega168A and a MCP2221 for the USB bridge. I successfully programmed the Atmega168A with an Arduino as ICSP with the following sketch (Minicore Atmega core):...
0
votes
2answers
42 views

Declaring and using array of structures in Arduino

Printing structure variables, I get default values. What is wrong with my code? struct SCENARIO { int Lamp_Pin = -1; int PB_Pin = -1; } ; SCENARIO _red; SCENARIO _yellow; SCENARIO _white; ...
0
votes
1answer
42 views

Pseudo-code of a program

I have written a code but I am facing a problem in pseudo-code that I am not able to change this code, so can anyone help me in translating the Arduino IDE program code to pseudo-code? #define ...
0
votes
2answers
45 views

Set slide potentiometer values

I am using the Grove - Slide Potentiometer (http://wiki.seeedstudio.com/Grove-Slide_Potentiometer). How can I set the potValue so that at maximum it will 128? int potPin= A0; int readValue; int ...
0
votes
0answers
26 views

Help with tachometer programme

This is my first programme, which is to control a brushless ESC motor and an IR sensor to read the props' RPM. However I can't seem to figure out why it's not working. The reading keeps giving me 0, ...
0
votes
2answers
71 views

How to exit while loop using keypad?

I can't seem to be able to escape a while loop using a keypad button. I've tried the solution from this thread: https://forum.arduino.cc/index.php?topic=79932.0 Here's my code: void alarm(){ char ...
-2
votes
1answer
34 views

Is it permissible to use strlcpy to copy an array to itself? [closed]

Task: delete "\n" at the beginning of the array. Example: char s_msg[15] = "\nHello world!"; void setup() { Serial.begin(115200); Serial.println("Load"); // Search \n if(strstr(s_msg, "\n") ...
0
votes
1answer
81 views

Connecting an Arduino Nano to a Raspberry Pi Zero

I'm working with an Arduino Nano Every, and I'm trying to connect it to the Raspberry Pi Zero for data collection from I2C sensors and writing/program code from the Pi to the Arduino. Typically, I ...
2
votes
2answers
317 views

Multiple Time-Sensitive Tasks

I'm using an Arduino Leonardo and need to perform two time-sensitive tasks like this: // Task 1 - Gets executed once a second (1Hz) // Execution of task needs approx 70ms task1(); //Sending a ...
-1
votes
2answers
39 views

Is it possible to get values only during vibration/movement from an Accelerometer(ADXL335/MPU6050)?

I'm trying to make a wearable motion sensor using ESP32 board and ADXL335 Accelerometer. Presently when I'm serial printing the output I'm getting the tilt value as well, which have different values ...
0
votes
1answer
148 views

How can I interrupt a delay() when a button is pressed?

I have created a device that allows my son to track time spent on activities and exchanges that time into a time he can use with his electronics (eTime). Full code in GITHUB I am having trouble ...
1
vote
1answer
817 views

cast double to long leads to unexpected results

I wrote a little program to show my problem: void setup() { Serial.begin(9600); double K=39.85; double a=K*100; Serial.print("a= "); Serial.println(a); long val_long = 0; val_long = ...
0
votes
2answers
30 views

default parameter class method

I have this function (which works fine): String Esper::rtcTimeString() { DateTime now = rtc.now(); char buf[] = "MM/DD/YY hh:mm:ss"; return now.toString(buf); } I'd like to have a default ...
0
votes
4answers
51 views

String to float on Arduino

I'm trying to convert a String to a float but I'm running into issues with precision, even with the Arduino's own String example I'm getting bad results. Example 0: Input string: 1.234567 After ...
0
votes
1answer
32 views

How to make a dynamic menu with a sub-menu ( Arduino mega or Arduino Uno)

I have an arduino mega with a LCD shield (from keyestudio KS2056). I am trying to create a menu with a submenu that would have addable and removable strings based on inputs from a RFID scanner(addable)...
-1
votes
1answer
27 views

Arduino recorder with SD card module

Can any one suggest me best device in cheap rates to record audio in to SD-card and vice versa from the speaker......i want to record audio into the sd card like as feedback from customer
0
votes
1answer
75 views

Continous running light with fading trail

In examples of FastLED library, there's the animation of a dot sweeping back and forth, with fading trails (file "DemoReel100", animation "sinelon"). How can I alter the code so instead of moving back,...
0
votes
1answer
29 views

MCU to MCU communication over UART

What would be the best way to send the following information from one MCU to another? Now I'm just sending the sentence over as is eg. Serial.print(sentence in here) Example sentence: 1306,60.123456,...
0
votes
2answers
51 views

A problem with measuring time in a for loop

I am familiar with timing using millis() function, but it seems that I have run into a problem with a for loop. The thing is, I am comparing encoder readings with a value entered via 4x4 keypad. Since ...
0
votes
0answers
29 views

RF24 code not working:

I watched this video and used his transmitter code and receiver code. However, it's not working. There's no response from the receiver. The transmitter stuck at the loop: if (!radio.write( &data,...
1
vote
1answer
35 views

My millis() code doesn't work

I am doing a project with bluetooth and an LED. I wrote a code which supposed to turn on an LED after it receives a byte of value 1 after 5 seconds, unless it receive another byte of value 1 (which ...
0
votes
1answer
28 views

Piezo buzzer with PWM on arduino uno with atmega328p in C on registers + analogRead on registers

I have a little project at the university where I have to use the timers to generate a pwm signal and get it into a piezo buzzer when something else turns over a certain value by using the registers, ...
0
votes
1answer
16 views

L298N Motor Driver - Code issuing “expected primary-expression before '=' token”

Programming Questions / L298N Driver - Code Issuing - " expected primary-expression before '=' token" Today at 07:20 pm Hello Arduino Community, Code is shown at bottom - please read below I've been ...
0
votes
0answers
19 views

Is Arduino code reversible? [duplicate]

I plan to create an Arduino that only responds to a specific input from the sensors. But really, I am not sure how secure would it be. Can the binary inside Arduino be converted back to its source? ...
0
votes
0answers
14 views

I want to code a countdown code that resets periodically for arduino [duplicate]

i am looking forward to do my first arduino project, but I'm a little stuck on the coding. I want to make an alarm that turns on when it is disconnected from bluetooth of smartphone. My idea on how ...
0
votes
1answer
81 views

Using serial communication in .c-files

I am currently trying to connect my Arduino Uno to my computer and let them communicate via UART. I started using a project from Github (here), which I'm trying to modify to get the next step via UART....
0
votes
1answer
35 views

How to burn bootloader and upload sketches on custom arduino?

Ive turned a project I breadboarded with arduino and other modules into one pcb on EAGLE. The pcb includes the ATMEGA328p smt version that doesn't have the bootloader installed. My question is then ...
0
votes
2answers
114 views

Coding issue with for loop

I have an issue with this piece of code concerning the use of 3 capcitance sensors each outputting a midi note chosen from one of three scales selected with a pot. Regarding the sensors triggering ...
1
vote
1answer
22 views

How to (optimally) fetch a button press? [duplicate]

For my hardware, I need to check if the button was pressed, but I need to do things only once every half a second. if (digitalRead(pin) == HIGH) { doStuff(); delay(500); } The above does ...
0
votes
4answers
43 views

How to link a computer processor to an Arduinno on a board? [closed]

I am completely new to Arduinno, so please forgive if the question is stupid. Here is the problem: I have a project where I want an Arduino (or similar microchip board) to handle some sensors and ...
1
vote
2answers
51 views

Mixed structure with int and string

I want to create a structure like this: struct commands { int cmd; char descr[25]; }; commands cmds[] = { {16, "Hammond Organ"}, {17, "Percussive Organ"}, {18, "Rock Organ"}, { 0, "" ...
0
votes
0answers
22 views

How to parse const char* for get data? [duplicate]

There is a variable like const char* date = "2019-12-16T18:30:58.708Z" I want to extract individual values ​​from this variable, such as: day, month, year, hour, minute, second Tell me, how ...
1
vote
1answer
111 views

ESP8266 Webserver ESP8266WebServer variable html page (not as one const char)

The aim is to display a non-static html page depending on some variable condition. The code I created hast the problem, that the esp8266 is ressetting in the moment I request the page. const char ...

1 2 3 4 5 28