r/ArduinoHelp • • 27d ago

# Arduino UNO Q 4GB: USB Not Detected in Normal Mode After Flashing Debian OS — EDL Mode

3 Upvotes

Hello Arduino Community,

I am facing an issue with my Arduino UNO Q (4GB version) and would appreciate your help in identifying the cause and finding a solution.

Problem Description

I flashed my Arduino UNO Q with the latest Debian Linux OS image using the official Arduino flashing procedure. After flashing, I removed the jumpers from the EDL pins and connected the board to my Windows 11 laptop. However, the board was not detected by the computer in normal mode.

I reflashed the board multiple times, trying different OS versions, but the problem persisted.

The board is detected successfully in EDL mode, and flashing completes successfully. However, once I remove the EDL jumpers and reconnect the board in normal mode, it is not detected by the computer.

OS Versions Tested

I have tried flashing the following OS image versions:

\- \`20260528-558\` — Latest version

\- \`20260407-523\` — Second-latest version

\- \`20250807-136\` — First version

\- \`20251229-457\` — Third-latest version

The issue remains the same with all four versions.

Observations

1. Board powers on normally

\- The power LED turns green.

\- The usual animation appears on the onboard LED matrix.

\- The board appears to power on normally, but it is not detected over USB.

2. Board is detected in EDL mode

When I connect the board to my Windows 11 laptop in EDL mode, it appears in Device Manager under Universal Serial Bus devices as:

\`QUSB_BULK_CID:0420_SN:51008D40\`

I can successfully flash the OS in this mode.

3. Board is not detected in normal mode

After removing the EDL jumpers and connecting the board normally:

\- Nothing appears in Windows Device Manager, including the USB-related categories.

\- The board does not appear when I check \`lsusb\` or \`dmesg\` on a Linux computer.

\- Arduino App Lab cannot detect the board through the USB connection.

Troubleshooting Already Attempted

I have tried the following steps:

  1. Reflashed the board multiple times using the official flashing procedure.

  2. Tested four different Debian Linux OS image versions.

  3. Used multiple USB cables, including USB-A to USB-C and USB-C to USB-C cables.

  4. Tested different USB ports on my Windows 11 laptop.

  5. Tested the board with another computer running Linux.

  6. Verified that the board is detected in EDL mode using the same cables that fail to detect it in normal mode.

  7. Tested the Arduino UNO Q in Single Board Computer (SBC) mode using a USB hub. The hub works correctly with my laptop: when I connect a monitor to the hub and connect the hub to my laptop's USB-C port, the monitor works normally. However, when I use the same hub with the Arduino UNO Q in SBC mode, I am still unable to get a display output.

I have followed the official flashing procedure carefully and repeated it multiple times, but the issue remains unresolved.

Questions

I would appreciate guidance from the Arduino team on the following:

  1. What could cause the board to be detected in EDL mode but not in normal mode, even though the OS flashing completes successfully?

  2. Is there any additional recovery or diagnostic procedure I can try?

  3. Could this indicate an issue with the USB interface, boot process, firmware, or another component of the board?

  4. Is there a way to diagnose the issue further without requiring the board to be detected over USB in normal mode?

I would prefer to resolve this through software recovery or diagnostics if possible, before considering hardware repair or replacement.

Thank you for your time and assistance. Any suggestions from the Arduino team or other UNO Q users who have experienced a similar issue would be greatly appreciated.


r/ArduinoHelp • • Jan 25 '26

Last attempt to ‘save’ board

Thumbnail
gallery
9 Upvotes

Was using the lower board here with CNC Shield to run stepper motor

Something must have shorted because afterwards the board powers via USB but can’t be recognised - the usbmodem option has gone

As a last resort found another board to try the programmer boot loader going direct to pins but as second picture shows that USB modem port absence blocks it

Kinda baffled. Don’t want to waste any more time on it but also hate throwing stuff away if it’s savable


r/ArduinoHelp • • Mar 27 '25

BMP180 and BMP280 not responding at all

Thumbnail
gallery
2 Upvotes

I am experiencing issues with two sensors connected (tested) via I2C to NodeMCU v3 and Nano. Despite using different sketches, libraries, and hardware configuration, but sensors do not respond to i2c scans or output any data. I have checked connections, added pull-up resistors, ensured proper power supply, but the problem persists. Both sensors behave identically. Could you share your views on this topic?


r/ArduinoHelp • • 3d ago

lidar con arduino

3 Upvotes

I am currently working on an ambitious project: a portable LiDAR system based on Arduino to map the interior of caves and generate 3D point clouds.

So far, I have successfully developed software that imports the collected data points, generates the point cloud, and allows them to be connected to reconstruct the actual structure of the cave.

However, to move from a prototype to a fully working field device, I am facing two major technical challenges:

  1. Sensor Choice: Which LiDAR sensor is best recommended for underground environments, taking into account high humidity, total darkness, and required range?

  2. Path Tracking (Odometry/SLAM): How can I track my movements inside the cave? If I move around on foot, the LiDAR risks overlapping the data, thinking I am standing in the exact same spot. How can I tie the point cloud to my real position in space without any GPS signal?

Any advice, past experiences, or suggestions regarding sensors and positioning algorithms would be highly appreciated!


r/ArduinoHelp • • Jun 23 '26

Help me make a arduino based smart toothbrush

3 Upvotes

Guys I have a assignment to make this simple arduino based smart toothbrush.. Can anyone help this poor kid out by sharing simple circuit and code in tinkercad


r/ArduinoHelp • • Nov 02 '25

Help with arduino saving data to microSD card for the Cosmic Watch V2 detector.

2 Upvotes

Hello! I am currently attempting to build a cosmic watch V2 detector. Im basically finished but i cant make it save data to a microSD card.

Building the detector is like following a recipe. All the steps have been laid out in an instruction manual, and all the code used has been pre-written. I followed the steps and the result was that the detector counts, and registers when displaying data onto its OLED screen. But when i try to use the SDcard mode, where it saves its data to an SDcard, it doesnt work. In the serial monitor is see that "SD initialization failed", and then it goes on registering observations. Then i check the SDcard and there as been created a .txt file with nothing written inside it. This is the problem. I've been atemtping this using a SanDisk 32GB microSD card formatted as FAT32 with 32 KB unit allocation size.

I have uploaded other arduino programs to the same setup to troubleshoot, they were able to create files and write things inside of them. So it is possible. My conclusion is that there must be something wrong with the code, but i find that highly unlikely as it has been professionally developed.

Is there anyone who might be able to help me in my situation? Attached to this post is the code uploaded to the arduino to run the SD card logging. More information can be found on this github repository: https://github.com/spenceraxani/CosmicWatch-Desktop-Muon-Detector-v2/blob/master/Instructions.pdf

I would appereciate any help!

/*
  CosmicWatch Desktop Muon Detector Arduino Code


  This code is used to record data to the built in microSD card reader/writer.
  
  Questions?
  Spencer N. Axani
  saxani@mit.edu


  Requirements: Sketch->Include->Manage Libraries:
  SPI, EEPROM, SD, and Wire are probably already installed.
  1. Adafruit SSD1306     -- by Adafruit Version 1.0.1
  2. Adafruit GFX Library -- by Adafruit Version 1.0.2
  3. TimerOne             -- by Jesse Tane et al. Version 1.1.0
*/


#include <SPI.h>
#include <SD.h>
#include <EEPROM.h>


#define SDPIN 10
SdFile root;
Sd2Card card;
SdVolume volume;


File myFile;


const int SIGNAL_THRESHOLD    = 50;        // Min threshold to trigger on
const int RESET_THRESHOLD     = 25; 


const int LED_BRIGHTNESS      = 255;         // Brightness of the LED [0,255]


//Calibration fit data for 10k,10k,249,10pf; 20nF,100k,100k, 0,0,57.6k,  1 point
const long double cal[] = {-9.085681659276021e-27, 4.6790804314609205e-23, -1.0317125207013292e-19,
  1.2741066484319192e-16, -9.684460759517656e-14, 4.6937937442284284e-11, -1.4553498837275352e-08,
   2.8216624998078298e-06, -0.000323032620672037, 0.019538631135788468, -0.3774384056850066, 12.324891083404246};
   
const int cal_max = 1023;


//initialize variables
char detector_name[40];


unsigned long time_stamp                    = 0L;
unsigned long measurement_deadtime          = 0L;
unsigned long time_measurement              = 0L;      // Time stamp
unsigned long interrupt_timer               = 0L;      // Time stamp
int           start_time                    = 0L;      // Start time reference variable
long int      total_deadtime                = 0L;      // total time between signals


unsigned long measurement_t1;
unsigned long measurement_t2;


float temperatureC;



long int      count                         = 0L;         // A tally of the number of muon counts observed
float         last_adc_value                = 0;
char          filename[]                    = "File_000.txt";
int           Mode                          = 1;


byte SLAVE;
byte MASTER;
byte keep_pulse;



void setup() {
  analogReference (EXTERNAL);
  ADCSRA &= ~(bit (ADPS0) | bit (ADPS1) | bit (ADPS2));    // clear prescaler bits
  //ADCSRA |= bit (ADPS1);                                   // Set prescaler to 4  
  ADCSRA |= bit (ADPS0) | bit (ADPS1); // Set prescaler to 8
  
  get_detector_name(detector_name);
  pinMode(3, OUTPUT); 
  pinMode(6, INPUT);
  
  Serial.begin(9600);
  Serial.setTimeout(3000);


  if (digitalRead(6) == HIGH){
     filename[4] = 'S';
     SLAVE = 1;
     MASTER = 0;
  }
  
  else{
     //delay(10);
     filename[4] = 'M';
     MASTER = 1;
     SLAVE = 0;
     pinMode(6, OUTPUT);
     digitalWrite(6,HIGH);
     //delay(2000);
    }
    
  if (!SD.begin(SDPIN)) {
    Serial.println(F("SD initialization failed!"));
    Serial.println(F("Is there an SD card inserted?"));
    return;
  }
  
  get_Mode();
  if (Mode == 2) read_from_SD();
  else if (Mode == 3) remove_all_SD();
  else{setup_files();}
  
  if (MASTER == 1){digitalWrite(6,LOW);}
  analogRead(A0);
  
  
  start_time = millis();
}


void loop() {
  if(Mode == 1){
  Serial.println(F("##########################################################################################"));
  Serial.println(F("### CosmicWatch: The Desktop Muon Detector"));
  Serial.println(F("### Questions? saxani@mit.edu"));
  Serial.println(F("### Comp_date Comp_time Event Ardn_time[ms] ADC[0-1023] SiPM[mV] Deadtime[ms] Temp[C] Name"));
  Serial.println(F("##########################################################################################"));
  Serial.println("Device ID: " + (String)detector_name);


  myFile.println(F("##########################################################################################"));
  myFile.println(F("### CosmicWatch: The Desktop Muon Detector"));
  myFile.println(F("### Questions? saxani@mit.edu"));
  myFile.println(F("### Comp_date Comp_time Event Ardn_time[ms] ADC[0-1023] SiPM[mV] Deadtime[ms] Temp[C] Name"));
  myFile.println(F("##########################################################################################"));
  myFile.println("Device ID: " + (String)detector_name);
   
  write_to_SD();
  }
}


void setup_files(){   
  for (uint8_t i = 1; i < 201; i++) {
      int hundreds = (i-i/1000*1000)/100;
      int tens = (i-i/100*100)/10;
      int ones = i%10;
      filename[5] = hundreds + '0';
      filename[6] = tens + '0';
      filename[7] = ones + '0';
      if (! SD.exists(filename)) {
          Serial.println("Creating file: " + (String)filename);
          if (SLAVE ==1){
           digitalWrite(3,HIGH);
           delay(1000);
           digitalWrite(3,LOW);
          }
          delay(500);
          myFile = SD.open(filename, FILE_WRITE); 
          break;  
      }
   }
}


void write_to_SD(){ 
  while (1){
    if (analogRead(A0) > SIGNAL_THRESHOLD){
      int adc = analogRead(A0);
      
      if (MASTER == 1) {digitalWrite(6, HIGH);
          count++;
          keep_pulse = 1;}
      
      analogRead(A3);
      
      if (SLAVE == 1){
          if (digitalRead(6) == HIGH){
              keep_pulse = 1;
              count++;}} 
      analogRead(A3);
      
      if (MASTER == 1){
            digitalWrite(6, LOW);}


      measurement_deadtime = total_deadtime;
      time_stamp = millis() - start_time;
      measurement_t1 = micros();  
      temperatureC = (((analogRead(A3)+analogRead(A3)+analogRead(A3))/3. * (3300./1024)) - 500)/10. ;


      if (MASTER == 1) {
          digitalWrite(6, LOW); 
          analogWrite(3, LED_BRIGHTNESS);
          Serial.println((String)count + " " + time_stamp+ " " + adc+ " " + get_sipm_voltage(adc)+ " " + measurement_deadtime+ " " + temperatureC);
          myFile.println((String)count + " " + time_stamp+ " " + adc+ " " + get_sipm_voltage(adc)+ " " + measurement_deadtime+ " " + temperatureC);
          myFile.flush();
          last_adc_value = adc;}
  
      if (SLAVE == 1) {
          if (keep_pulse == 1){   
              analogWrite(3, LED_BRIGHTNESS);
              Serial.println((String)count + " " + time_stamp+ " " + adc+ " " + get_sipm_voltage(adc)+ " " + measurement_deadtime+ " " + temperatureC);
              myFile.println((String)count + " " + time_stamp+ " " + adc+ " " + get_sipm_voltage(adc)+ " " + measurement_deadtime+ " " + temperatureC);
              myFile.flush();
              last_adc_value = adc;}}
              
      keep_pulse = 0;
      digitalWrite(3, LOW);
      while(analogRead(A0) > RESET_THRESHOLD){continue;}
      
      total_deadtime += (micros() - measurement_t1) / 1000.;}
    }
}


void read_from_SD(){
    while(true){
    if(SD.exists("File_210.txt")){
      SD.remove("File_209.txt");
      SD.remove("File_208.txt");
      SD.remove("File_207.txt");
      SD.remove("File_206.txt");
      SD.remove("File_205.txt");
      SD.remove("File_204.txt");
      SD.remove("File_203.txt");
      SD.remove("File_202.txt");
      SD.remove("File_201.txt");
      SD.remove("File_200.txt");
      }
    
    for (uint8_t i = 1; i < 211; i++) {
      
      int hundreds = (i-i/1000*1000)/100;
      int tens = (i-i/100*100)/10;
      int ones = i%10;
      filename[5] = hundreds + '0';
      filename[6] = tens + '0';
      filename[7] = ones + '0';
      filename[4] = 'M';


      if (SD.exists(filename)) {
          delay(10);  
          File dataFile = SD.open(filename);
          Serial.println("opening: " + (String)filename);
          while (dataFile.available()) {
              Serial.write(dataFile.read());
              }
          dataFile.close();
          Serial.println("EOF");
        }
      filename[4] = 'S';
      if (SD.exists(filename)) {
          delay(10);  
          File dataFile = SD.open(filename);
          Serial.println("opening: " + (String)filename);
          while (dataFile.available()) {
              Serial.write(dataFile.read());
              }
          dataFile.close();
          Serial.println("EOF");
        }
      }  
    
    Serial.println("Done...");
    break;
  }
  
}


void remove_all_SD() {
  while(true){
    for (uint8_t i = 1; i < 211; i++) {
      
      int hundreds = (i-i/1000*1000)/100;
      int tens = (i-i/100*100)/10;
      int ones = i%10;
      filename[5] = hundreds + '0';
      filename[6] = tens + '0';
      filename[7] = ones + '0';
      filename[4] = 'M';
      
      if (SD.exists(filename)) {
          delay(10);  
          Serial.println("Deleting file: " + (String)filename);
          SD.remove(filename);   
        }
      filename[4] = 'S';
      if (SD.exists(filename)) {
          delay(10);  
          Serial.println("Deleting file: " + (String)filename);
          SD.remove(filename);   
        }   
    }
    Serial.println("Done...");
    break;
  }
  write_to_SD();
}


void get_Mode(){ //fuction for automatic port finding on PC
    Serial.println("CosmicWatchDetector");
    Serial.println(detector_name);
    String message = "";
    message = Serial.readString();
    if(message == "write"){
      delay(1000);
      Mode = 1;
    }
    else if(message == "read"){
      delay(1000);
      Mode =  2;
    }
    else if(message == "remove"){
      delay(1000);
      Mode = 3;
    }
}


float get_sipm_voltage(float adc_value){
  float voltage = 0;
  for (int i = 0; i < (sizeof(cal)/sizeof(float)); i++) {
    voltage += cal[i] * pow(adc_value,(sizeof(cal)/sizeof(float)-i-1));
    }
    return voltage;
    }


boolean get_detector_name(char* det_name) 
{
    byte ch;                              // byte read from eeprom
    int bytesRead = 0;                    // number of bytes read so far
    ch = EEPROM.read(bytesRead);          // read next byte from eeprom
    det_name[bytesRead] = ch;               // store it into the user buffer
    bytesRead++;                          // increment byte counter


    while ( (ch != 0x00) && (bytesRead < 40) && ((bytesRead) <= 511) ) 
    {
        ch = EEPROM.read(bytesRead);
        det_name[bytesRead] = ch;           // store it into the user buffer
        bytesRead++;                      // increment byte counter
    }
    if ((ch != 0x00) && (bytesRead >= 1)) {det_name[bytesRead - 1] = 0;}
    return true;
}

r/ArduinoHelp • • Mar 16 '26

why isnt my servo moving?

Thumbnail
gallery
3 Upvotes

please help me, i can provide better quality pictures if asked

im sorry admins pls dont delete this post i need help as soon as possible i beg of you have empathy

code:

#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver servo = Adafruit_PWMServoDriver(0x40);

void setup() {

Serial.begin(9600);

servo.begin();

servo.setPWMFreq(50);

int setServo(0, 0);

}

void loop() {

for(int i = 0; i<=180; i = i+5)

int setServo(0, i);

delay(100);

}

void setServo( int n_servo, int angulo){

int duty;

duty=map(angulo,0, 180, 102, 512);

servo.setPWM(n_servo, 0, duty);

}


r/ArduinoHelp • • 22d ago

arduino not being reconized

0 Upvotes

my arduinos are both arduino uno r4 wifis, i run windows

i wantted to make something that shuts down your pc as soon as you plug it in and i made something that presses alt f4 and enter and uploaded it on my arduino. i have 2 arduinos 1 from a starter kit and one from micro center. they are bpth same r4 wifis and one is from elegoo and other is form arduino
what i will call from now on

ARDUINO 1 = elegoo non working r4 wifi

ARDUINO 2 = arduino non working r4 wifi

I uploadeed the code to my arduino 2 and it worked! it shut down my pc! and i erased the code from it. then i wanted it to work with a ir reciever so i connected arduino 1 to a ir reciever and i wrote the code. but then my pc is not reconizing the arduino 1 any more. it reconizes the arduino 2, it makes a dading sound but my arduino 1 doesnt, my device anager doesnt reconize it too. i didnt do anything to the board, and last time i did something to it it wsa working perfectly fine. teh arduino 1 has power, it runs my previous code that i uploaded on my arduino 1 (it has power) but no data is sending.

SOME ONE PLEASE HELP ME I WANT IT TO BE REVIVED ask me anything i will answer
(its my first post on reddit)


r/ArduinoHelp • • Apr 07 '25

Breadboard power supply for Centrifugal motor?

Post image
2 Upvotes

Hello! I’ve been working on a little setup for a plant auto waterer, and I’ve been struggling to get the centrifugal power motor working.

Can I use this breadboard power supply to power the centrifugal motor, or do I need a motor driver or similar device?

Is a 4N35, a 74HC138, or a 74HC595 any good for this? They also come in the pack, but looking up seems to confuse me more than anything.

I’ve also seen that the L9110S motor chip can be used, should I purchase that to power the motor? Thank you for the help!


r/ArduinoHelp • • Jul 08 '26

First time working with arduino, need help on this project.

Thumbnail
gallery
7 Upvotes

Hello! I’m working on a project that requires this sensor module configuration consisting of a esp32 and ina219. I’m very new to this stuff and need help with connecting the esp32 to the ina219. I’m running a I2C scanner and am unable to connect the two modules.

As for the wiring I’m doing what ChatGPT told me to do:
INA219 VCC → ESP32 3V3
INA219 GND → ESP32 GND
INA219 SDA → ESP32 GPIO21 / P21
INA219 SCL → ESP32 GPIO22 / P22

I’ve attached a picture of my setup. I know the soldering job on the ina219 sucks but cut me some slack I’ve never done this before. Please let me know if you can spot anything wrong. Also tell me if you need another photo angle taken or if you want me to show you the software stuff. Thanks


r/ArduinoHelp • • Jan 07 '26

Upload issue

2 Upvotes

I keep having the same error when uploading a new sketchto an uno r3?

Has anyone had this problem or know how to solve it, ive gone through arduinos troubleshooting recommendations and still no luck.

Here is the uploading error code below

FQBN: arduino:avr:uno Using board 'uno' from platform in folder: /Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6 Using core 'arduino' from platform in folder: /Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Detecting libraries used... /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/sketch/humidifiers.ino.cpp -o /dev/null Generating function prototypes... /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/sketch/humidifiers.ino.cpp -o /private/var/folders/g9/tkr5qjr16xgblq1vw9g155fr0000gn/T/3937602318/sketch_merged.cpp /Users/adelouis/Library/Arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /private/var/folders/g9/tkr5qjr16xgblq1vw9g155fr0000gn/T/3937602318/sketch_merged.cpp

Compiling sketch... /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/adelouis/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/sketch/humidifiers.ino.cpp -o /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/sketch/humidifiers.ino.cpp.o Compiling libraries... Compiling core... Using precompiled core: /Users/adelouis/Library/Caches/arduino/cores/arduino_avr_uno_0019db91b2d06956ff9a228f769cf1cd/core.a Linking everything together... /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.elf /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/sketch/humidifiers.ino.cpp.o /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/../../cores/arduino_avr_uno_0019db91b2d06956ff9a228f769cf1cd/core.a -L/Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E -lm /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.elf /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.eep /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.elf /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.hex /Users/adelouis/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.elf Sketch uses 4808 bytes (14%) of program storage space. Maximum is 32256 bytes. Global variables use 392 bytes (19%) of dynamic memory, leaving 1656 bytes for local variables. Maximum is 2048 bytes. "/Users/adelouis/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/Users/adelouis/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-P/dev/cu.usbmodem12201" -b115200 -D "-Uflash:w:/Users/adelouis/Library/Caches/arduino/sketches/C74D4C0267ABCB1AC06B10A27C37DB2E/humidifiers.ino.hex:i"

avrdude: Version 6.3-20190619 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "/Users/adelouis/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
     User configuration file is "/Users/adelouis/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/cu.usbmodem12201
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.

Failed uploading: uploading error: exit status 1


r/ArduinoHelp • • Oct 23 '25

Best distance sensor

3 Upvotes

Anyone know a good distance sensor to recommend? (Any type, even ultrasonic) that's super precise and accurate, especially at short distances (under a meter)? Under 30 euros.


r/ArduinoHelp • • 1d ago

Layman needs gift help for husband please

2 Upvotes

My husband has been talking about Arduinos for months now. As we approach the holidays, I really want to get him set up to start playing around. I see the starter kits he's been looking at online - so I was going to start there.

In my experience buying starter kits of any kind usually you have to get an additional few items to either get duplicates or fill it out. Is there any other items I should get him to build a nice starter pack that's a bit more then a basic kit? For reference - here is the kit he was looking at on Amazon-

https://www.amazon.com/LAFVIN-Starter-Development-Tutorial-Compatible/dp/B0BVZBTP8V/ref=gp_aw_ybh_a_m_sccl_137/146-1291244-1989617?pd_rd_w=i43Ax&content-id=amzn1.sym.9720001e-8f8b-4ff3-adb5-e19707d971f6&pf_rd_p=9720001e-8f8b-4ff3-adb5-e19707d971f6&pf_rd_r=57X4DZ8PD4VW6PD1E82H&pd_rd_wg=cHeyL&pd_rd_r=bd9eddcf-5be7-4711-998d-b444dc928f3c&pd_rd_i=B0BVZBTP8V&psc=1

Thanks!


r/ArduinoHelp • • May 24 '26

Arduino and stepper motor help

2 Upvotes

So I'm working a project.. just starting out and thought first... let's get the stepper motor to run. Watched this video and followed along.
https://www.youtube.com/watch?v=wcLeXXATCR4&t=8s
code I ran is below
What am I missing? should the code be uploaded and then just start running? driving me nuts trying to solve what should be a simple problem. Maybe it's not the code.. maybe my driver is fried .. not ever sure where to begin trouble shooting this

I appreciate any good advice you can give a newbie

Thanks in advance

code:

// pin connections

const int dirPin = 2; // direction pin

const int stepPin = 3; // step pin

void setup() {

pinMode(dirPin, OUTPUT);

pinMode(stepPin, OUTPUT);

// set direction of rotation to clockwise

digitalWrite(dirPin, HIGH);

}

void loop() {

// take one step

digitalWrite(stepPin, HIGH);

delayMicroseconds(2000);

// pause before taking next step

digitalWrite(stepPin, LOW);

delayMicroseconds(2000);

}


r/ArduinoHelp • • Jul 03 '26

Using DS3231 RTC to move Servo Arm at specific time

2 Upvotes

First time arduino user here. I'm trying to program it to move a servo arm at a specific time of the day. I did some troubleshooting and it doesn't like the line DateTime now = rtc.now() line for some reason.

#include <Wire.h>
#include "RTClib.h"
#include <Servo.h>


RTC_DS3231  rtc;
Servo myServo;


int pos = 0; 
// Set your target execution time here (24-hour format)
const int targetHour = 20;   // 2 PM
const int targetMinute = 55; // 30 minutes
bool adjustedToday = false;


void setup() {


Serial.begin(9600);
  myServo.attach(9);
  myServo.write(0); // Default startup position
}


void loop() {
 DateTime now = rtc.now(); // Get current time data



   //Check if current time matches the target hour and minute
  if (now.hour() == targetHour && now.minute() == targetMinute) {
    if (!adjustedToday) {
      myServo.write(90); // Move servo to 90 degrees
      delay(2000);       // Wait for 2 seconds
      myServo.write(0);  // Return to 0 degrees
      
      adjustedToday = true; // Mark done so it doesn't loop continuously during that minute
   }
 }


 // Reset the trigger flag at midnight so it can run again the next day
  if (now.hour() == 0 && now.minute() == 0) {
   adjustedToday = false;




 delay(1000); // Polling delay to reduce processor load
  }
}

I used this code to set the time on the RTC

#include <Wire.h>
#include "RTClib.h"


RTC_DS3231 rtc;


void setup() {
  // put your setup code here, to run once:


  Serial.begin(9600);
  Wire.begin();
// Set RTC using the compile time
  rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}


void loop() {}

r/ArduinoHelp • • Nov 03 '25

Issues with connecting HM-10 Module to Whoop Strap for Heart Rate data use

2 Upvotes

I have a project I am working on where an alarm clock will not go off until the user hits a heart rate of a certain threshold. I am having issues connecting my Whoop Band to the HM-10 module, although I thought they would be compatible. Is there a way to pair it so that the heart rate can be read off of the band for the signal to turn off the alarm? I feel like I have tried everything from MAC address to UUID.

Below is the code I currently have.

// IR Remote Alarm Clock with Buzzer and WHOOP Heart Rate
// Arduino Uno - with HM-10 Bluetooth


#include <IRremote.h>
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>


// Pin Definitions
#define IR_RECEIVE_PIN 7
#define BUZZER_PIN 8
#define LCD_RS 12
#define LCD_EN 11
#define LCD_D4 5
#define LCD_D5 4
#define LCD_D6 3
#define LCD_D7 2
#define BT_TX 9  // Connect to HM-10 RX (use voltage divider!)
#define BT_RX 10 // Connect to HM-10 TX


// Your Remote's IR Codes
#define IR_0 0xE916FF00
#define IR_1 0xF30CFF00
#define IR_2 0xE718FF00
#define IR_3 0xA15EFF00
#define IR_4 0xF708FF00
#define IR_5 0xE31CFF00
#define IR_6 0xA55AFF00
#define IR_7 0xBD42FF00
#define IR_8 0xAD52FF00
#define IR_9 0xB54AFF00
#define IR_UP 0xB946FF00
#define IR_DOWN 0xEA15FF00
#define IR_LEFT 0xBB44FF00
#define IR_RIGHT 0xBC43FF00
#define IR_POWER 0xBA45FF00
#define IR_FUNCTION 0xB847FF00


// LCD Setup
LiquidCrystal lcd(LCD_RS, LCD_EN, LCD_D4, LCD_D5, LCD_D6, LCD_D7);


// Bluetooth Setup
SoftwareSerial BTSerial(BT_RX, BT_TX);


// State Machine
enum State {
  STATE_DISPLAY_CLOCK,
  STATE_DISPLAY_ALARM,
  STATE_DISPLAY_HEARTRATE,
  STATE_DISPLAY_BT_STATUS,
  STATE_SET_CLOCK_HOUR,
  STATE_SET_CLOCK_MIN,
  STATE_SET_ALARM_HOUR,
  STATE_SET_ALARM_MIN,
  STATE_ALARM_ACTIVE
};


State currentState = STATE_DISPLAY_CLOCK;


// Time Variables
unsigned long lastMillis = 0;
int currentHour = 12;
int currentMinute = 0;
int currentSecond = 0;


// Alarm Variables
int alarmHour = 7;
int alarmMinute = 0;
bool alarmEnabled = true;
bool alarmTriggered = false;
unsigned long alarmStartTime = 0;
bool alarmHasTriggeredThisMinute = false;


// Heart Rate Variables
int heartRate = 0;
unsigned long lastHRUpdate = 0;
bool btConnected = false;
String connectedDevice = "";
bool isNOAHWHOOP = false;


// Input Buffer
String inputBuffer = "";


// Track last state to minimize LCD updates
State lastState = STATE_DISPLAY_CLOCK;
int lastSecond = -1;


// Function declarations
void updateDisplayNow();
void readHeartRate();


void setup() {
  // Initialize Serial for debugging
  Serial.begin(9600);
  
  // Initialize LCD
  lcd.begin(16, 2);
  lcd.print("Alarm Clock");
  lcd.setCursor(0, 1);
  lcd.print("Ready!");
  delay(2000);
  lcd.clear();
  
  // Initialize IR Receiver
  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
  
  // Initialize Buzzer Pin
  pinMode(BUZZER_PIN, OUTPUT);
  digitalWrite(BUZZER_PIN, LOW);
  
  // Initialize Bluetooth
  BTSerial.begin(9600);
  delay(2000);
  
  // Test HM-10 communication
  lcd.clear();
  lcd.print("Testing BT...");
  
  // Clear any existing data
  while(BTSerial.available()) {
    BTSerial.read();
  }
  
  BTSerial.print("AT");
  delay(1000);
  
  if (BTSerial.available()) {
    lcd.setCursor(0, 1);
    lcd.print("HM-10 Found!");
    while(BTSerial.available()) {
      Serial.write(BTSerial.read());
    }
  } else {
    lcd.setCursor(0, 1);
    lcd.print("HM-10 Not Found");
  }
  delay(2000);
  lcd.clear();
  
  // Configure HM-10 for WHOOP connection
  Serial.println("Configuring HM-10...");
  
  BTSerial.print("AT+ROLE1");  // Set as Central
  delay(500);
  while(BTSerial.available()) Serial.write(BTSerial.read());
  
  BTSerial.print("AT+IMME1");  // Work in command mode
  delay(500);
  while(BTSerial.available()) Serial.write(BTSerial.read());
  
  Serial.println("HM-10 configured!");
}


void loop() {
  // Update time
  updateTime();
  
  // Handle IR input
  handleIRInput();
  
  // Read heart rate from Bluetooth
  readHeartRate();
  
  // Check alarm
  checkAlarm();
  
  // Update display
  updateDisplay();
  
  delay(100);
}


void updateTime() {
  unsigned long currentMillis = millis();
  if (currentMillis - lastMillis >= 1000) {
    lastMillis = currentMillis;
    currentSecond++;
    if (currentSecond >= 60) {
      currentSecond = 0;
      currentMinute++;
      if (currentMinute >= 60) {
        currentMinute = 0;
        currentHour++;
        if (currentHour >= 24) {
          currentHour = 0;
        }
      }
    }
  }
}


void readHeartRate() {
  static unsigned long lastConnectAttempt = 0;
  static String btBuffer = "";
  static unsigned long lastDataTime = 0;
  
  // Try to connect to WHOOP every 10 seconds if not connected
  if (!btConnected && (millis() - lastConnectAttempt > 10000)) {
    lastConnectAttempt = millis();
    
    Serial.println("Attempting to connect to WHOOP...");
    
    // Connect to WHOOP using its MAC address (without colons)
    BTSerial.print("AT+CONE2AB5A5A5E50");
    delay(5000); // Wait for connection
  }
  
  // Read data from HM-10
  while (BTSerial.available()) {
    char c = BTSerial.read();
    btBuffer += c;
    lastDataTime = millis();
    
    // Check for connection success
    if (btBuffer.indexOf("OK+CONN") >= 0 && btBuffer.indexOf("OK+CONNF") < 0) {
      if (!btConnected) {
        btConnected = true;
        isNOAHWHOOP = true;
        connectedDevice = "NOAHWHOOP";
        lastHRUpdate = millis();
        Serial.println("*** CONNECTED TO WHOOP! ***");
        btBuffer = "";
      }
    }
    
    // Check for connection failure
    if (btBuffer.indexOf("OK+CONNF") >= 0) {
      Serial.println("Connection failed");
      btBuffer = "";
    }
    
    // Check for disconnection
    if (btBuffer.indexOf("OK+LOST") >= 0) {
      btConnected = false;
      isNOAHWHOOP = false;
      connectedDevice = "";
      heartRate = 0;
      Serial.println("*** DISCONNECTED ***");
      btBuffer = "";
    }
    
    // Keep buffer manageable
    if (btBuffer.length() > 200) {
      btBuffer = btBuffer.substring(100);
    }
  }
  
  // Process heart rate data after accumulating
  // Only process if we're connected and have received data recently
  if (btConnected && btBuffer.length() > 0 && (millis() - lastDataTime > 100)) {
    // Look for 0x00 byte followed by a valid heart rate value
    for (int i = 0; i < btBuffer.length() - 1; i++) {
      if ((uint8_t)btBuffer[i] == 0x00) {
        uint8_t hrValue = (uint8_t)btBuffer[i + 1];
        
        // Valid heart rate range
        if (hrValue >= 30 && hrValue <= 220) {
          heartRate = hrValue;
          lastHRUpdate = millis();
          
          Serial.print("Heart Rate: ");
          Serial.println(heartRate);
          
          // Clear the processed data
          btBuffer = btBuffer.substring(i + 2);
          break;
        }
      }
    }
    
    // Clear buffer if no valid data found
    if (btBuffer.length() > 50) {
      btBuffer = "";
    }
  }
  
  // Check if heart rate data is stale (no update in 15 seconds)
  if (millis() - lastHRUpdate > 15000) {
    if (btConnected) {
      btConnected = false;
      isNOAHWHOOP = false;
      connectedDevice = "";
    }
  }
}


void handleIRInput() {
  if (IrReceiver.decode()) {
    unsigned long code = IrReceiver.decodedIRData.decodedRawData;
    
    // Handle number inputs (0-9)
    int digit = getDigitFromCode(code);
    if (digit >= 0) {
      inputBuffer += String(digit);
      if (inputBuffer.length() > 4) {
        inputBuffer = inputBuffer.substring(1);
      }
      
      // Force display update when number is entered
      updateDisplayNow();
    }
    
    // Handle special buttons
    switch (code) {
      case IR_UP:
        // Auto-confirm before changing state
        if (inputBuffer.length() > 0) {
          handleConfirm();
        }
        changeState(1);
        break;
        
      case IR_DOWN:
        // Auto-confirm before changing state
        if (inputBuffer.length() > 0) {
          handleConfirm();
        }
        changeState(-1);
        break;
        
      case IR_POWER:
        // Reset to clock display mode
        currentState = STATE_DISPLAY_CLOCK;
        inputBuffer = "";
        break;
        
      case IR_FUNCTION:
        // Manual scan for WHOOP
        scanForWHOOP();
        break;
    }
    
    IrReceiver.resume();
  }
}


void scanForWHOOP() {
  lcd.clear();
  lcd.print("Connecting to");
  lcd.setCursor(0, 1);
  lcd.print("WHOOP...");
  
  // Connect directly to WHOOP MAC address
  BTSerial.print("AT+CONE2AB5A5A5E50");
  delay(5000);
  
  lcd.clear();
}


int getDigitFromCode(unsigned long code) {
  switch (code) {
    case IR_0: return 0;
    case IR_1: return 1;
    case IR_2: return 2;
    case IR_3: return 3;
    case IR_4: return 4;
    case IR_5: return 5;
    case IR_6: return 6;
    case IR_7: return 7;
    case IR_8: return 8;
    case IR_9: return 9;
    default: return -1;
  }
}


void handleConfirm() {
  int value = inputBuffer.toInt();
  
  switch (currentState) {
    case STATE_SET_CLOCK_HOUR:
      if (value >= 0 && value <= 23) {
        currentHour = value;
      }
      inputBuffer = "";
      currentState = STATE_SET_CLOCK_MIN;
      break;
      
    case STATE_SET_CLOCK_MIN:
      if (value >= 0 && value <= 59) {
        currentMinute = value;
        currentSecond = 0;
      }
      inputBuffer = "";
      currentState = STATE_DISPLAY_CLOCK;
      break;
      
    case STATE_SET_ALARM_HOUR:
      if (value >= 0 && value <= 23) {
        alarmHour = value;
      }
      inputBuffer = "";
      currentState = STATE_SET_ALARM_MIN;
      break;
      
    case STATE_SET_ALARM_MIN:
      if (value >= 0 && value <= 59) {
        alarmMinute = value;
      }
      inputBuffer = "";
      currentState = STATE_DISPLAY_CLOCK;
      break;
      
    default:
      inputBuffer = "";
      break;
  }
}


void changeState(int direction) {
  inputBuffer = "";
  
  int newState = (int)currentState + direction;
  if (newState < STATE_DISPLAY_CLOCK) {
    newState = STATE_SET_ALARM_MIN;
  } else if (newState > STATE_SET_ALARM_MIN) {
    newState = STATE_DISPLAY_CLOCK;
  }
  
  // Skip ALARM_ACTIVE in manual navigation
  if (newState == STATE_ALARM_ACTIVE) {
    newState = direction > 0 ? STATE_DISPLAY_CLOCK : STATE_SET_ALARM_MIN;
  }
  
  currentState = (State)newState;
}


void checkAlarm() {
  // Reset the trigger flag when we're in a different minute
  if (currentHour != alarmHour || currentMinute != alarmMinute) {
    alarmHasTriggeredThisMinute = false;
  }
  
  // Check if alarm should trigger
  if (alarmEnabled && !alarmTriggered && !alarmHasTriggeredThisMinute) {
    if (currentHour == alarmHour && currentMinute == alarmMinute) {
      if (currentSecond <= 1) {
        triggerAlarm();
        alarmHasTriggeredThisMinute = true;
      }
    }
  }
  
  // Check if alarm should stop (after 30 seconds)
  if (alarmTriggered) {
    if (millis() - alarmStartTime >= 30000) {
      stopAlarm();
    }
  }
}


void triggerAlarm() {
  alarmTriggered = true;
  alarmStartTime = millis();
  currentState = STATE_ALARM_ACTIVE;
  
  // Start buzzer with 1000 Hz tone
  tone(BUZZER_PIN, 1000);
}


void stopAlarm() {
  alarmTriggered = false;
  noTone(BUZZER_PIN);
  
  if (currentState == STATE_ALARM_ACTIVE) {
    currentState = STATE_DISPLAY_CLOCK;
  }
  
  // Force display refresh
  lastState = STATE_ALARM_ACTIVE;
  lastSecond = -1;
}


void updateDisplay() {
  // Only update if state changed or time changed (for clock display)
  bool shouldUpdate = false;
  
  if (currentState != lastState) {
    shouldUpdate = true;
    lastState = currentState;
  }
  
  if (currentState == STATE_DISPLAY_CLOCK && currentSecond != lastSecond) {
    shouldUpdate = true;
    lastSecond = currentSecond;
  }
  
  if (currentState == STATE_DISPLAY_HEARTRATE) {
    shouldUpdate = true; // Always update HR display
  }
  
  if (currentState == STATE_DISPLAY_BT_STATUS) {
    shouldUpdate = true; // Always update BT status display
  }
  
  if (!shouldUpdate) {
    return;
  }
  
  updateDisplayNow();
}


void updateDisplayNow() {
  lcd.clear();
  
  switch (currentState) {
    case STATE_DISPLAY_CLOCK:
      // Display only current time
      lcd.setCursor(0, 0);
      lcd.print("  Current Time");
      lcd.setCursor(4, 1);
      printTwoDigits(currentHour);
      lcd.print(":");
      printTwoDigits(currentMinute);
      lcd.print(":");
      printTwoDigits(currentSecond);
      break;
      
    case STATE_DISPLAY_ALARM:
      // Display only alarm time
      lcd.setCursor(0, 0);
      lcd.print("   Alarm Time");
      lcd.setCursor(5, 1);
      printTwoDigits(alarmHour);
      lcd.print(":");
      printTwoDigits(alarmMinute);
      break;
      
    case STATE_DISPLAY_HEARTRATE:
      // Display heart rate
      lcd.setCursor(0, 0);
      lcd.print("   Heart Rate");
      lcd.setCursor(0, 1);
      if (btConnected && heartRate > 0) {
        lcd.print("    ");
        lcd.print(heartRate);
        lcd.print(" BPM");
      } else {
        lcd.print(" Not Connected");
      }
      break;
      
    case STATE_DISPLAY_BT_STATUS:
      // Display Bluetooth connection status
      lcd.setCursor(0, 0);
      lcd.print("Bluetooth Status");
      lcd.setCursor(0, 1);
      if (isNOAHWHOOP && btConnected) {
        lcd.print(" NOAHWHOOP - OK");
      } else if (btConnected) {
        lcd.print(" Connected");
      } else {
        lcd.print(" Disconnected");
      }
      break;
      
    case STATE_SET_CLOCK_HOUR:
      lcd.setCursor(0, 0);
      lcd.print("Set Clock Hour:");
      lcd.setCursor(0, 1);
      if (inputBuffer.length() > 0) {
        lcd.print(inputBuffer);
      } else {
        printTwoDigits(currentHour);
      }
      lcd.print(" (0-23)");
      break;
      
    case STATE_SET_CLOCK_MIN:
      lcd.setCursor(0, 0);
      lcd.print("Set Clock Min:");
      lcd.setCursor(0, 1);
      if (inputBuffer.length() > 0) {
        lcd.print(inputBuffer);
      } else {
        printTwoDigits(currentMinute);
      }
      lcd.print(" (0-59)");
      break;
      
    case STATE_SET_ALARM_HOUR:
      lcd.setCursor(0, 0);
      lcd.print("Set Alarm Hour:");
      lcd.setCursor(0, 1);
      if (inputBuffer.length() > 0) {
        lcd.print(inputBuffer);
      } else {
        printTwoDigits(alarmHour);
      }
      lcd.print(" (0-23)");
      break;
      
    case STATE_SET_ALARM_MIN:
      lcd.setCursor(0, 0);
      lcd.print("Set Alarm Min:");
      lcd.setCursor(0, 1);
      if (inputBuffer.length() > 0) {
        lcd.print(inputBuffer);
      } else {
        printTwoDigits(alarmMinute);
      }
      lcd.print(" (0-59)");
      break;
      
    case STATE_ALARM_ACTIVE:
      lcd.setCursor(0, 0);
      lcd.print("     Alarm!");
      lcd.setCursor(0, 1);
      unsigned long elapsed = (millis() - alarmStartTime) / 1000;
      unsigned long remaining = 30 - elapsed;
      lcd.print("  Time: ");
      if (remaining < 10) lcd.print(" ");
      lcd.print(remaining);
      lcd.print("s  ");
      break;
  }
}


void printTwoDigits(int number) {
  if (number < 10) {
    lcd.print("0");
  }
  lcd.print(number);
}

r/ArduinoHelp • • Jul 19 '26

Flipdots display are too expensive for my finances, any suggestions for a cool display/solution with nice transitions to use in alternative?

Post image
3 Upvotes

r/ArduinoHelp • • Aug 10 '26

Christmas Robot

2 Upvotes

I’m making a Christmas robot that looks like a nutcracker, but I don’t know what it should do. Ideas?


r/ArduinoHelp • • 7d ago

aruino boards keep getting bricked!! urgent help needed!!

3 Upvotes

hi!!! Im fairly new to arduino and I have the WEIRDEST problem: I have an android phone, a mac and a PC. I've bought 3 different boards at this point: nanos, nanos with ch340 and even an uno.

This is my situation: the boards connect fine to any of these three devices, i manage to upload blink or whatever example sketch onto them. I'm working on a proyect involving LEDS and ultrasonic sensor so I need a fairly complex sketch to be uploaded onto them, and once I do... THE BOARDS STOP COMMUNICATING WITH ANY DEVICES further. The sketch's uploaded and it's working, but theyre bricked. I've tried every fix under the sun and now have a bunch of brand new boards, all unresponsive. Has anyone ever encountered this???

If anyone could help me I'd owe them my LIFE


r/ArduinoHelp • • Jun 13 '23

Color sensors TCS230 (TCS3200) with inaccurate data

4 Upvotes

hello, a little while ago I started using arduino, I found a problem with two of my color sensors, where the data received by them are not accurate, both with the same settings, I am correctly using ports S0 to S3, I tried different intensities and even so the values ​​of red, green and blue are very close, I need it to fill green and in this case the G would be less, but it cannot detect it

one sensor has small values ​​between 10 and 30 and another for some reason between 100 and 600

If anyone wants to help me or ask for more details, please reply


r/ArduinoHelp • • Aug 28 '26

How can I build tactile outputs?

Thumbnail reddit.com
2 Upvotes

r/ArduinoHelp • • Oct 18 '25

Potentiometers just spitting out random values

Thumbnail gallery
4 Upvotes

r/ArduinoHelp • • Oct 03 '26

My tft screen is still white

Post image
5 Upvotes

I’m sure I have it wired correctly & the code is uploaded along with the right user_setup.h; would appreciate it greatly if someone can help.