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.

251 questions
3
votes
1 answer

Why is this looping?

I am trying to do something very simple. I want the LED to fade from full brightness to off. This works... However, the LED turns back on to full brightness and fades again, in a loop. I am not sure why. I think I am missing something obvious. …
Keltari
  • 163
  • 6
2
votes
2 answers

Unwanted ghosting with charlieplexed LEDs

I have a very simple PCB that uses 3 GPIO on a ATtiny85 to control 6 LEDs using charlieplexing. When I try to program certain patterns of lit LEDs (pseudo PWM) I get some LEDs lighting dimly when they should be fully off. Example where only top or…
RedGrittyBrick
  • 1,182
  • 6
  • 14
2
votes
2 answers

How to get 2 loop functions to cooperate?

I have a OLED SSD1306 & DS3231 RTC, 2 buttons to set the time & date. My project is to display a scrolling text at the top of the OLED, the RTC time in the middle, the day & date on the last line. My issue is I can't get the scrolling text & the…
Stiglitz
  • 21
  • 2
1
vote
2 answers

Adding another flow sensor to sketch

Adding another flow sensor to sketch I have a water flow sketch I use for my freshwater consumption. I would like to adapt it to use for diesel fuel consumption. The difference is with a diesel motor the fuel pump sucks more fuel than it burns…
1
vote
1 answer

Monitoring multi analog ports with ACS712 current sensors

Making a Auto Blast Gate for dust collection in my wood shop. Arduino Nano using ACS712's to detect when tool is in use. Using DRV8825 to drive a single Stepper motor that will spin a disk to line up blast gate for the tool in use. Code works as…
Greg
  • 39
  • 7
1
vote
3 answers

delay() not working inside loop() block

Edited and attached code here. This section didn't execute. The delay(15000); doesn't execute, I mean the sketch didn't execute this line no matter where to put it. // include the SPI library: #include // set pin 53 as the slave…
laoadam
  • 45
  • 5
1
vote
1 answer

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 of doing. Our project is to have music play when…
Larry C
  • 11
  • 1
1
vote
1 answer

Gate opener code help - should be working

Can anyone see any errors in my code that would affect the opening command? Upon first power up the open command (remoteA) works fine. After that the opening command does what its supposed to except it only momentarily fires "digitalWrite (power,…
Slickpuss
  • 21
  • 4
0
votes
1 answer

Combined code to run a 2-zone radiant floor system. Cannot get 'RadiantMain' to work. Better description in beginning of code

Trying to combine code to run a 2-zone radiant floor heating system. The menu code works perfectly. When I select MenuC 'Run main' it executes to RadiantMain prints test and then returns to menu options again. Been working on this for weeks and…
0
votes
1 answer

Confusion on array definition at Arduino website

See the below explanation about Arrays from Arduino's official site: Creating (Declaring) an Array All of the methods below are valid ways to create (declare) an array. int myInts[6]; int myPins[] = {2, 4, 8, 3, 6}; int mySensVals[6] = {2, 4,…
user1245
  • 117
  • 7
-2
votes
2 answers

how to convert a line of code for arduino to receive a value

im sending the value 1500 from another MCU with fdserial_txChar(transmit, send >> 7); // send Higher 7 bits fdserial_txChar(transmit, send & 0x7F); // send Lower 7 bits and was receiving it with code that looked like this servo1 =…
-2
votes
1 answer

Middle school Student stuck and needs help

I have a middle school student who is having problems getting her pollution sensor to work when asked to. I have attached her document to this post. Can anyone help her fix the issue? int conductivitySensorValue; //initialize an integer variable to…
-2
votes
1 answer

I need to power some coils sequentially, can someone help me with the code?

int coilSetOne = 0; int coilSetTwo = 1; int coilSetThree = 2; int coilSetFour = 3; int switchInput = 4; void setup() { pinMode(coilSetOne, OUTPUT); pinMode(coilSetTwo, OUTPUT); pinMode(coilSetThree, OUTPUT); pinMode(coilSetFour, OUTPUT); …
Zivicium
  • 3
  • 1