Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Code review is systematic examination of your Arduino sketch. It is intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers' skills.

0
votes
0answers
27 views

What's wrong with my code (arduino lilypad) [on hold]

I have this code to be run on a Arduino Lilypad and it's supposed to blink 4 red LED's when finds a pulse and then fade 3 white LED's. I've uploaded the code to the project but doesn't work as ...
0
votes
1answer
23 views

Arduino loop over a function is always displaying 0 as final values

I trying to loop over a function in arduino to get values for 2000 times, and then divide it by 2000 to get an average offset: int16_t x_offset = 0; int16_t y_offset = 0; int16_t z_offset = 0; And ...
0
votes
1answer
23 views

Trying to use Tap Detection solution using ADXL345 with Arduino

I am using ADXL345 sensor connecting with Arduino via I2C interface, I am able to test the data at tri-axial axis but as there are some other features also, which I am going to try with Tap detection ...
-1
votes
0answers
92 views

Can someone check my button box/rotary encoder sketch and maybe correct it?

What I try to accomplish is a F1 steering wheel from the RB13. 10 momentary push buttons and 5 rotary encoders. Also an Nextion 4,3" will be placed to check all kinds of info. I took an existing ...
0
votes
1answer
25 views

Compile Error for Arduino Sketch

I am attempting to increase the volume of a Max9744 20 watt amplifier from Adafruit using an Arduino sketch. I am just a very beginner and working with my grandson, this may be more than I am capable ...
0
votes
0answers
25 views

Why does HC-06 slows dows to a halt when involving both Serial.print and Serial.read?

I'm working on a project that has to output MPU9250 data through bluetooth (because through a microSD card was a total failure). For that I'm using an Android device (Samsung J5) and a app called ...
0
votes
0answers
33 views

Rc-Switch Receiver Code not receiving anything

Hi so I'm Having Problems on my receiver code which uses the RC-switch.h library, The transmitter code is OK and it prints the corresponding values on the serial monitor but the receiver code doesn't ...
0
votes
0answers
24 views

Virtual Wire transmitter code

I'm Having problems on my virtual wire transmitter code. when i press one button the backward button is continuously being pressed even when im not pressing it. Here is the code // TRANSMITTER CODE #...
1
vote
1answer
39 views

Rc car controller using the RC-switch library

simulate this circuit – Schematic created using CircuitLab (Newbie in arduino) Hi so i have a project which involves creating an rc car which uses the 433Mhz rf module and an arduino nano with ...
-2
votes
1answer
91 views

hx711 and load cell read out 0 for calibration

I'm using this tutorial from Sparkfun https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide And using THEIR code. The only difference is I added a delay so it wouldn't ...
0
votes
0answers
41 views

Arduino button trigger coding

I am trying to write a simple coding to change the color of an RGB LED using a push button trigger. I just need the the pin output to change when the button is pressed. I would like to do this using ...
1
vote
0answers
259 views

Sending data from webserver to Arduino

Hello Arduino enthusiasts! I've been working on a keypad lock system for school lately and I need some advice.Basically, my code checks if the entered passcode is the same than a predefined passcode ...
0
votes
1answer
48 views

Servo issue, won't go into negative range

I'm trying to create a small laser "turret" with x-axis control. The arduino receives input through IR sensor. I'm having a problem where my servo will preform my up and reset function(moves and ...
0
votes
2answers
156 views

Keypad password check issue

I am working on a school project, basically I have to create a lock system that opens a fictive gate when the correct code is entered. We have been asked to simulate our system before actually ...
0
votes
1answer
60 views

My outputs are not outputting any current at only two of my pinmodes but work fine on the others

My pinMode output 5 and 6 don't works with this code but will work when they are stand alone. What is causing the Arduino to not output anything from these outputs within my code? #include <...
0
votes
1answer
230 views

Problem to display Ntp time on an oled using U8G2 lib

So I have this code to get ntp time and display it on serial port. But I want to display it on a 1.30 inch I2C oled with a SH1106 controller using the U8G2 library. The only problem is I don't know ...
1
vote
2answers
424 views

Sending Float values from Python to Arduino via serial communication

I want to Control the current flowing through a circuit using an Arduino. I have trained a PID controller for this purpose. I am using a current sensor to determine the error. It runs successful on my ...
-3
votes
2answers
618 views

Problem “Didn't find PN53x board” in Arduino Uno E-Card Reader [closed]

This is component to make E-Card reader, using arduino uno pn532 Code if (success) { // Display some basic information about the card Serial.println("Found an ISO14443A card"); Serial....
0
votes
1answer
90 views

When I turn on the servo it spins on its own before going to the right position and start the sketch

I can't get my head around this: when I turn the servo on it just spins on its own as if it's setting up, it goes to an angle superior to the one I want it to go. (Don't mind if it has to set up but ...
0
votes
1answer
191 views

Combining codes for 3 sensors [closed]

I am trying to combine codes for my 3 sensors: GSR, Pulse sensor, and ECG but I keep getting errors. I have a poor background in coding. I have the 3 codes separately and I'm not the one who wrote ...
0
votes
0answers
97 views

Push button to LED Code does not Properly Execute

I was making a program that would randomly select an order of lights utilizing the random-seed and random functions in Arduino. After selecting an order randomly, the LEDs would proceed to go off ...
1
vote
3answers
166 views

Arduino Uno “if” statement is ignored in code and halts execution when using Serial.ReadString()

I'm having a weird issue with my Uno trying to power on a PWM fan using a MOSFET. I'm setting a simple power on/off code using commands sent over the Serial Monitor, and although this code worked ...
0
votes
2answers
2k views

Getting error ets jan 8 2013,rst cause:4,boot mode(1,6) wdt reset

I'm working on a project to send ultrasonic sensor data to my webserver. For that I'm using ESP8266 WiFi module, 3.3V regulator IC by giving input volt of 5v from aduino uno. I successfully uploaded ...
0
votes
3answers
288 views

Pause running program using a pushbutton

I have a program that flashes three LED in sequence indefinitely. How can O program a pushbutton to pause the program in the middle of the code? Also, can I modify the code so that pressing the ...
0
votes
1answer
527 views

LED Blinking Using Push button

Whenever I upload the following program I am getting error message showing "expected initializer before interval". Kindly Help me to solve out this probleme. const byte button=2; const byte LED=10; ...
0
votes
2answers
159 views

SSID was not declared in this scope

so I am new to arduino and coding in general, I am trying to use the arduino to remotely survey plants, I am using this guide: https://create.arduino.cc/projecthub/arduino/plant-communicator-7ea06f. ...
-1
votes
3answers
589 views

Need help on the “expected primary expression before ”}“ token”

#include <SPI.h> #include <nRF24L01.h> #include <RF24.h> #include "Arduino.h" #include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" #define M11 2 #define M12 3 #define M13 ...
0
votes
0answers
250 views

Using a keypad to play an audio file on Arduino Mega and Adafruit VS1053?

I am trying to use a keypad to trigger an audio file using an Arduino Mega and Adafruit VS1053 Music Maker. I have gotten the music files to play independently, and when the correct number is entered ...
0
votes
1answer
127 views

Code is not working (Matrix keypad) [closed]

I am new to Arduino. I am learning from Arduino Cookbook. I was using tinkercad.com for running my Arduino code. But it is not working. The Serial monitor should show the key which I have pressed on ...
0
votes
1answer
219 views

Arduino Servo with Serial

I have an interesting problem. I want to control ESC and servo with Arduino. I'm using HC-12 to communicate with 2 Arduino and I'm using SoftwareSerial on the nano. #include <SoftwareSerial.h> ...
0
votes
1answer
321 views

Checksum is wrong - Air Quality Monitoring Station PMS5003, BME280 | Code review

I working at air quality station. I measure particulate matter with PMS5003 and meteorological parameters with BME280. Everything seems to work just fine, but sometimes program hangs on checksum ...
1
vote
1answer
400 views

Problem opening multiple text files simultaneously/in-order using <SD.h>

I am looking to log analog sensor data using 3 pins, A1, A2, A3. My project requires continuous mapping of data, and hence an SD card shield was necessary. However, I need to log the incoming data ...
-2
votes
1answer
326 views

I keep getting stray '/302'. [duplicate]

I even rewrote the code and it still didn't work. How can I fix this? #include "pitches.h" void setup() { // put your setup code here, to run once: pinMode(4, OUTPUT); } void loop() { // ...
2
votes
0answers
61 views

My Arduino freezes if power removed from the HMI

I have an Arduino (Pro Mini) connected to an HMI display over serial. When the user pushes a button on the HMI screen, it activates a relay attached to one of the digital pins on the Arduino. For ...
7
votes
4answers
606 views

delay(time); vs if(millis()-previous>time); and drift

Going through an old project, I had code on two Arduino Due that looked like this void loop() { foo(); delay(time); } taking to heart the majority of literature on using delay(); I recoded this ...
0
votes
2answers
424 views

How do I stop a servo motor at the current position when using a serial port? I want it to remain in one position when receiving “0”

I am working on a project where I would like values received from an Xbox Kinect will activate components on my Arduino. Currently, I am trying to get a servo motor to turn on and rotate when the ...
1
vote
2answers
2k views

Problem with a DHT11 Temperature & Humidity sensor

UPDATE: SOLVED I'm new in the Arduino world and today i was trying to make a simple program to show the temparature an humidity with this sensor. I made a circuit following one tutorial and nothing ...
0
votes
2answers
208 views

Communication with socketserver fails after specific number of packets

I'm trying to implement a full-duplex communication between my ESP8266 and a socketserver running on my laptop. In concrete I need each of the devices to initiate communication whenever it needs to. ...
0
votes
2answers
66 views

interrupt not triggered correctly

I have an arduino uno and want to react to three sensors, which should trigger an ISR. I wrote the following program, and for sensor 3 it works, however the other two sensor don't seem to trigger an ...
0
votes
2answers
3k views

Change the baud rate of HC-05

#include <SoftwareSerial.h> SoftwareSerial BTSerial(10, 11); // RX | TX void setup() { pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode ...
0
votes
2answers
121 views

Strings from serial are not equal

In my code I have that string:String code = rs1 + rs2 + rs3; //rs1=034, rs2=000, rs3=017 It means that code = "034000017". But if I run if (code.equals("034000017")) Serial.println("OK"); There is ...
0
votes
2answers
132 views

Speed measurement from lidar sensor for automatic braking system

For a school project I have been working on a system that will automatically brake when there is danger. Only the requirements are more strict (safety) than just using a ping sensor and detecting a ...
0
votes
1answer
164 views

How to only detect the opening and closing of door sensor once

im quite new to Arduino coding. Currently im trying to create an alarm and when the alarm ring, the user will just need to remove the door sensor once to stop the alarm and listen for the next alarm. ...
0
votes
1answer
345 views

Integer array definitions: Length

I'm defining a variable as integer and want to use thati int specLength = 17; int spec[specLength-1]; When I do this, I get the following error message: TestProgram:34: error: array bound is not ...
0
votes
0answers
139 views

How to get HC-05 working

I was making a project of voice activated Arduino and I encountered this problem. When I connect the HC-05 to Android and then say something (I'm using the AMR App), it recognizes my voice but the ...
1
vote
2answers
119 views

Why do I have to open Serial Monitor to display what is in loop function?

Why do I have to open Serial Monitor to display non-NaN values retrieved from DHT22, what am I doing wrong in the code below? #include <DHT.h> #include <Wire.h> #include <...
0
votes
0answers
24 views

Multiple Function calling problem in hardware project

I am trying to make a mechanical slider which can move Horizontally and Vertically. I need the slider to move to 6 specific spots. For horizontal movement I used a Motor Encoder to count the steps. ...
1
vote
2answers
97 views

motor hard stop vs coasting

I'm using this motor driver with 2 of these motors to control a skid steer robot. To get the robot to coast to a stop, I use this code: analogWrite(MotLPWM, 0); //coast to stop analogWrite(...
0
votes
0answers
37 views

Servo tangled when delays changed

I am using a servo with a UNO R3 and Elegoo Car kit. I am moving a servo to 90, 10, 90 and 180 degrees. If I increase the delays inbetween the servo.write commands, the servo turns opposite to what it ...
1
vote
1answer
135 views

I2C Packet ocasionally send a garbage data

I have a project with Arduino working as I2C slave. The master request data each 300ms. The code of Arduino is: /* Name: SimpleClass_Applcation.ino Created: 5/26/2017 4:18:28 PM Author: ...