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.
41
questions with no upvoted or accepted answers
3
votes
0
answers
452
views
Integration of MAX30100 and DS18B20 Thermal Probe Integration
This is for my final year project that I have been tasked with designing a patient monitoring system. However, during the last stretch of model prototyping, I am experiencing issues with my MAX30100 ...
3
votes
0
answers
2k
views
Encoder + Bounce2 Library
I am working towards debouncing my keyes rotary encoder using the Bounce2 library found here ( https://github.com/thomasfredericks/Bounce2 ).
I believe the problem lies in my code as there isn't much ...
2
votes
0
answers
68
views
Am I maximising my A0 readout rate with this peak-detection code?
I have a pulse going into A0 on a Nano, and want to detect the peak voltage. With low-pass filtering to slow down the input pulse I'm still reading marginally too slow.
The code overall inhibits a ...
2
votes
0
answers
156
views
Please help with my tinkercad code. Debouncing stopwatch with lcd
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ssPin = 8;
int resetPin = 9;
bool cntrRunning = false;
int sec = 0;
int min = 0;
double currentMillis;
void setup()
{
...
2
votes
0
answers
784
views
How to Adjust MQ131 Sensor?
The problem
Hey. I'm trying to use the sensor Mq131 to measure some ozone data in a closed environment, but I'm having some bad time to adjust the trim in the sensor and get results in ppb. By ...
2
votes
0
answers
399
views
Error compiling for board Arduino Nano 33 BLE
I am trying to use pulse sensor with Arduino Nano 33 BLE sense, but when I verify it, it shows Error compiling for board Arduino Nano 33 BLE. The code is from the pulse sensor website. The code works ...
2
votes
0
answers
133
views
Help with code for changing motor speed depending on MPU6050 angles read
I have been trying to create code where my MPU6050 is constantly reading the angle it is at and based on that angle, increase or decrease the motor speed. For example the motor will be off when the ...
2
votes
0
answers
2k
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 ...
2
votes
1
answer
733
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 ...
2
votes
0
answers
2k
views
Arduino Uno doesn't work as Manchester code receiver
I'm sending some data from ATTINY85 to Arduino UNO using 433Mhz modules. Coding is Manchester using Manchester.h library from here.
Transmitting data works perfectly, 433 receiver gets data alright.
...
1
vote
0
answers
47
views
Code for a load cycler seems to be stuck
I am trying to make a battery load cycler to charge and discharge a battery repeatedly for a certain amount of cycles and here is my code:
bool in_charge_mode;
int cycles = 0;
float cutoffvoltage = 2....
1
vote
0
answers
232
views
Code question: LCD keypad Shield. How do I define the buttons?
I am trying to adapt a alarm clock sketch that used external buttons, but I would like to utilize a LCD Keypad Shield. The data sheet says all the buttons are on pin A0, so every button is "set ...
1
vote
0
answers
111
views
RFM69 Sending Failure
Hi I'm trying to get the RFM69 rf module to work on an arduino uno.
Here is my code:
#include <SPI.h>
// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID 0 // Must be ...
1
vote
0
answers
31
views
servos act strangely instead of stopping/starting
I am trying to make it so that my robot rolls straight when pin 8 is high and stop when pin 8 is low, the 2 servos is constant rotation servos. instead the servos spin when the wire touches it pin ...
1
vote
0
answers
105
views
Project doesn't work after 2 - 3 times, requires frequent turning off and on
I am new to Arduino and I am working on a project. This project inspired me and I tried doing it.
The following code was provided in the description:
int maxPeople = 5; // maximum number of people ...
1
vote
0
answers
612
views
U-blox GPS module (and TinyGPS library): altitude data getting stuck at strange values
We have built a HAB (high-altitude balloon) tracker based on an Arduino and a U-blox GPS module, but we have a sporadic issue where the altitude data gets stuck at odd (usually low) values. The ...
1
vote
0
answers
803
views
How to stop my 16*2 lcd blink?
Here I wrote code for my weighting scale measurement. In which I added an on/off switch for my LCD display. But in defined delay time my LCD is a blink and I do not want it. I want my LCD switch on/...
1
vote
0
answers
1k
views
Wemos d1 mini code not uploading
I have a wemos d1 mini. I uploaded a code in wemos d1 mini and after that my wemos mini not working. I tried to upload another code in it even the led blink sketch and even a blank sketch but whenever ...
1
vote
0
answers
249
views
Why is my buzzer always on?
I wanted to make a buzzer go off when the distance measured by the ultrasonic sensor becomes more than 100cm. The things used in this project are a 4x4 keypad, an hc-sr04 ultrasonic sensor, and a ...
1
vote
0
answers
60
views
Can someone check my schematic and code? My Led is not turning on
Led1 is on the left Led2 is on the right The code is making LED1 blink every second but it should also turn on Led2 so that whenever I press the push button it should turn off Led2. But Led2 isn't ...
1
vote
0
answers
63
views
Automatic water pump Trigger System - I need my code FIXED
int out = LED_BUILTIN;
int strt = 3;
int stp = 9;
void setup() {
pinMode(out,OUTPUT);
pinMode(strt,INPUT);
pinMode(stp,INPUT);
}
void loop() {
while(true) {
if(digitalRead(strt) == LOW) ...
1
vote
0
answers
143
views
Help with code not working
I built a button box, everything is wired up and all of the push buttons work using the code below, but for some reason my rotary encoders are not working, well 3 out of the 4 are not working. Is ...
1
vote
0
answers
271
views
ESP32-POE/ISO unstable after 10 days of power up
i have one ESP32-POE and ESP32-POE and i'm using the Olimex RS485 module to read a power meter that is placed near the ESP32 (5 meters of CAT5 cable - 9600 8N1).
My device has this workflow (it's ...
1
vote
0
answers
864
views
I2C master's output is always 255
we are using 2 Arduino UNO as a master/slave for this i2c protocol. we used the first Arduino(slave) as a sensor that will input dummy data (in this case, temperature data). the Arduino(master) should ...
1
vote
0
answers
629
views
I am trying to rewrite an RFID with a MEGA2560 and a RFID-RC522
I have been trying to rewrite an RFID tag so it is the same as my other one. I have code that will read both separately but I cannot find any already written for the MEGA2560 that will work for me. ...
1
vote
0
answers
79
views
Potentiometer motor system is not working
I am setting up a potentiometer system that includes a motor that is supposed to spin with the potentiometer changing the speed of the spin and a button to reverse it. I checked the coding and it is ...
1
vote
0
answers
126
views
lightshow project
Hello guys. I'm working on a little lightshow that has 3 extra feature's when i press the button. depending on the variable counter the lights should do something and it should message you that you ...
1
vote
0
answers
38
views
How do I get my servo to turn using bluetooth, is this a glitch?
I'm very new to coding with arduino so please excuse my naivety, For an electronics assignment I am making a servo turn back and forth using a HM10 BLE however each time I press a button that sends '0'...
1
vote
0
answers
67
views
How do I have this audio and LED activate ONLY when a button is held using an Arduino?
I have this code that I am using to play a sound effect where I used a program called wav2c to convert a .wav file to number values that I put into a header file that I use in the code to generate the ...
1
vote
0
answers
237
views
Sending a union from Arduino via serial communication and parsing it in python
I want to send a union from Arduino to a python script running on a pc, and I want to parse the received union. I have read lots of topics online but I am stuck on how to do it in the most efficient ...
1
vote
0
answers
74
views
Analog pins giving off the same value
So recently I made code that used two custom sensors that are connected to the analog pin A0 & A5. Schematic can be seen here (http://inmoov.fr/test-your-finger-sensor/).
const int ono = A0;
...
1
vote
0
answers
2k
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. ...
1
vote
0
answers
342
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
1
answer
224
views
Quick Programming Check/Review
I've been racking my head trying to start programming in a library organized method. My code works, but the translation and split to a .h and .cpp file is riddled with errors.
It's gotta be stupidly ...
0
votes
0
answers
258
views
problem controlling rgb led with one button
I'm trying to make a lamp which quality to change color by pressing a
button, pressing once turns on red, pressing again turns on blue and so on, but I also want it to have a light effect in which it ...
0
votes
0
answers
69
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,...
0
votes
0
answers
149
views
when submit data to ESP8266, ets Jan 8 2013,rst cause:4, boot mode:(1,6) wdt occurs
I am trying to make my ESP8266(nodemcu) as a Web server. When my code operates, and user connects esp's wifi and enters '192.168.4.1/set_peroid' by IE or chrome, this webpage appears:
This is ...
-1
votes
1
answer
197
views
Code causing Servo motor not to work!
My sketch is compiling and loading, but when the program runs, the Servo motor does not work. The buttons work, the LED light works, Piezo buzzer plays the melody, the Stepper motor works but not ...
-1
votes
1
answer
1k
views
Wemos D1 mini freezing after a few minutes
I´m using a Wemos D1 mini board to control a RGB LED Strip and programmed a simple code with the Arduino IDE. The Wemos conects to my Internet just fine and with the IP adress I can change the RGB ...
-2
votes
1
answer
159
views
Can someone check my code? My Arduino isn't doing a consistent count cycle
I'm wondering if someone could have a look at my code and let me know if there's something wrong with it. I had the code done for me a while back and did a quick test and it seemed to work. I have now ...
-2
votes
1
answer
3k
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 ...