r/arduino • • 9h ago

Hardware Help Which board should I choose for hairclip with screen Arduino project

3 Upvotes

Hi everyone! I'm trying to start working on more creative projects on Arduino and I found a project online about a hairclip with screen on it, which I found to be really cute (in case you don't know, it's this one). My doubt is that I've seen different components used to do it. What would be better, a LILYGO T-display-S3 (like in the video I just linked), a LILYGO T-display chip 32 (like in this one) or a 1.28 in TFT (like in this one). I've worked with Arduino before, but it's been a long time and I'm basically relearning again haha, so I'm not sure about which one would be the best option for the project. Of course any suggestions different than the ones I listed are also welcome. Thanks a lot! :)


r/arduino • • 9h ago

Beginner's Project Button Box assistance

Post image
3 Upvotes

So this is my first arduino project and having a little difficulty. the setup will be used for sim racing and the toggle switches should just send a quick pulse (not continuous). same for the button.
- each toggle should only light up in the on position.
- the left most toggle (ignition) should "control" the button. when on, the button led lights up and is able to start the sim car.
- i was able to get 1 toggle working pretty reliably.
- once i add 2 more toggles (3 in line) they all stop working (haven't even attempted the 4th toggle and button yet)

i am trying to use the joystick library, and ill be honest, AI, to create the sketch. i guess id like to know, does my diagram look sound? is there anything i should look to use in the sketch? maybe an example i can use to compare with what i have

(diagram using parts as close as i could find in cirkit designer)

really appreciate any guidance

/*
 * Arduino Pro Micro (ATmega32U4)
 *
 * Three SPST toggle switches as pulsed joystick buttons.
 *
 * No external resistors required.
 * Uses internal INPUT_PULLUP.
 *
 * Switch 1: D2 -> Joystick Button 1
 * Switch 2: D3 -> Joystick Button 2
 * Switch 3: D4 -> Joystick Button 3
 *
 * Wiring per switch:
 *   Contact A -> GND
 *   Contact B -> Digital input pin
 *
 * Switch ON  = LOW
 * Switch OFF = HIGH
 *
 * Every stable toggle transition (ON or OFF)
 * generates one short joystick button press.
 */


#include <Joystick.h>


const uint8_t NUM_SWITCHES = 3;


const uint8_t SENSE_PIN[NUM_SWITCHES] = {
  2, 3, 4
};


const uint8_t RX_LED_PIN = 17;


// Timing
const unsigned long DEBOUNCE_MS = 25;
const unsigned long PULSE_MS = 40;


// Joystick configuration
Joystick_ Joystick(
  JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_JOYSTICK,
  NUM_SWITCHES,
  0,
  false, false, false,
  false, false, false,
  false, false,
  false, false, false
);


// Switch tracking
bool lastReportedState[NUM_SWITCHES];
bool lastReading[NUM_SWITCHES];


unsigned long lastDebounceTime[NUM_SWITCHES];
unsigned long pulseEndTime[NUM_SWITCHES];


void setup() {


  for (uint8_t i = 0; i < NUM_SWITCHES; i++) {


    pinMode(SENSE_PIN[i], INPUT_PULLUP);


    lastReading[i] = digitalRead(SENSE_PIN[i]);


    lastReportedState[i] = lastReading[i];


    lastDebounceTime[i] = 0;


    pulseEndTime[i] = 0;


    Joystick.releaseButton(i);
  }


  // RX LED mirrors switch 1
  pinMode(RX_LED_PIN, OUTPUT);


  digitalWrite(
    RX_LED_PIN,
    lastReading[0] == LOW ? LOW : HIGH
  );


  Joystick.begin();
}


void loop() {


  for (uint8_t i = 0; i < NUM_SWITCHES; i++) {
    handleSwitch(i);
  }
}


void handleSwitch(uint8_t i) {


  bool reading = digitalRead(SENSE_PIN[i]);


  // Detect a change in raw input
  if (reading != lastReading[i]) {


    lastDebounceTime[i] = millis();


    lastReading[i] = reading;
  }


  // Wait for stable input
  if ((millis() - lastDebounceTime[i]) > DEBOUNCE_MS) {


    if (reading != lastReportedState[i]) {


      lastReportedState[i] = reading;


      // Generate one joystick pulse
      pulseEndTime[i] = millis() + PULSE_MS;


      Joystick.pressButton(i);


      // RX LED mirrors switch 1
      if (i == 0) {


        digitalWrite(
          RX_LED_PIN,
          reading == LOW ? LOW : HIGH
        );
      }
    }
  }


  // Release joystick button after pulse
  if (
    pulseEndTime[i] != 0 &&
    (long)(millis() - pulseEndTime[i]) >= 0
  ) {


    Joystick.releaseButton(i);


    pulseEndTime[i] = 0;
  }
}

r/arduino • • 16h ago

OSS + local models + heterogeneous hardware meetup in Los Altos 12/8

Thumbnail
luma.com
3 Upvotes

Disclosure: I work on the community team at Modular, which is now part of Qualcomm - feel free to remove this post if it isn't relevant to this sub, not trying to spam

We're hosting a meetup in Los Altos on Tuesday, Dec 8 (and virtually via livestream) focused on new hardware bringup on our stack and OSS.

  • The hardware plugin system for bringing new hardware to MAX
  • Bringing up the Modular stack on Qualcomm edge hardware
  • Demo of a hybrid Mojo/C port of Quake running on an Arduino UNO Q
  • Contributing to MAX and Mojo now that MAX is source available

Chris Lattner will also give a look back at the year and a high-level view of where he thinks things are heading.

In-person (there's a raffle for an Arduino UNO Q) or livestream: https://luma.com/dec-meetup


r/arduino • • 20h ago

Hardware Help Dunno if this belongs here but I'm too frustrated, help pls

Thumbnail
gallery
3 Upvotes

For some context, I've got making a minisumo as a project, so here it is my problem:

If you check my pic (Yeah, bad soldering, need to improve it someday), you're going to see that I'm using an ESP32-C3 with a Tb6612fng H bridge paired with two N20 motors (1100 RPM, 12v), I'd checked its datasheet before so it is supposed to be able to handle those two motors simultaneously.

I decided to make a basic code just to try it out, the motors worked out well for 15 secs until the left one suddenly stopped (Channel B). i already measured the three pins of channel b and, apparently, it's fine.

What would you recommend me to do? Please I'm getting so frustrated for this