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

Questions tagged [code-review]

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
23 views

Nested “switch” statements menu

I know that menus were discussed perhaps a thousand times here and everywhere. But using a ready solution is not something that I'm looking for because I know I won't learn the concept if I use them. ...
0
votes
1answer
48 views

Am I able to set up a code where I can have two ways of turning something on?

I am pretty new to Arduino. I've created a code with the help of many YouTube tutorials to control a servo with a button. I decided it has gotten a little un-exciting so I've been trying to add a ...
0
votes
0answers
28 views

How do I spilt a string of data into four different parts [closed]

The string has seconds, miles away from our point and latitude and longitude, and all we need is the lag and long 4271.645999999997,s,28.00301266666665,mi,28.48737418308778,N,-81.36210510944983,E. we ...
0
votes
1answer
30 views

New code results in audio noise

I am working on a circuit that can record audio to an SD when a switch is HIGH and stop recording when the switch is LOW. I am using the TMRpcm library. I previously had an issue solved on these two ...
0
votes
0answers
15 views

Arduino TFT LCD buttons reappear after fillScreen(BLACK);

I am very new to TFT screens and I am developing some code to display on a little information board, however I have come across an issue. Once I call tft.fillScreen(BLACK);, it writes testing but ...
-1
votes
0answers
25 views

Help In Understanding irrecv.enableIRIn() and irrecv.resume()

I started out with Arduino quite recently and is a noob. I have an IR Receiver came mounted on a breakout board and is currently learning how to use the IR library. If I'm correct, the irrecv....
0
votes
1answer
37 views

Ultrasonic sensor showing weird reading

When i run a test code in Newping library for ultrasonic sensor SR04 then in works properly but when i run the actual code for obstacle avoiding robot then it shows 0 cm everytime. This means that ...
-1
votes
1answer
33 views

how to code LED turning signals on smart car [closed]

this question is regarding how to add turn led signals on arduino powered smart car. I have 4 leds to give turn indications on my smart car(line follower, obstacle avoider, Bluetooth mobile controlled ...
-1
votes
1answer
52 views

esp8266 WiFi Cannot Connect to a PHP Server

I am using a magnetic float switch sensor to monitor water level in a tank. I am using a ESP8266 board. I am trying to send the data collected by it to a php page in a host called "weris.link". I've ...
1
vote
2answers
50 views

Arduino pow() making 9's

I am having a temporary lapse of judgement, or not understanding how the power method works, but when I put 10 to the power of a number, it is that value -1. So: 10*10 = 100 Then I would assume, 10^...
0
votes
1answer
25 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
49 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 ...
0
votes
1answer
34 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
253 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
29 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
245 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
393 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
45 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
600 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
125 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
302 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
63 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
368 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
850 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
1k 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
126 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
473 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
164 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
384 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 ...
1
vote
3answers
4k 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
509 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
784 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
314 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
1k 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
320 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
195 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
368 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
538 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
620 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
421 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() { // ...
3
votes
1answer
77 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
746 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
722 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
4k views

Problem with a DHT11 Temperature & Humidity sensor

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 happend, the ...
0
votes
2answers
413 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
122 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
5k 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
189 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
177 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
222 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. ...