Skip to content
ThinkNMake — Don't just think. Make it.

Maker community

Builds tagged #arduino

Share what you built — photos, video, the code and the part that nearly didn’t work. Every post here started with someone’s first blinking LED.

11
Builds
10
Makers
6
Spaces

Log in to share what you’re building.

Sort
  • Aarav Karki

    Aarav KarkiMember

    @aarav_builds

    Three weeks of tuning and my line follower finally does the full track without leaving it once. The trick was dropping the base speed before the sharp turns instead of trying to fix it with a bigger correction. #robotics #linefollower #arduino
    arduino
    // PID line following — the values that finally worked for me
    const float Kp = 0.08, Ki = 0.0002, Kd = 0.9;
    int baseSpeed = 140;          // was 200 — too fast for the hairpin
    
    void loop() {
      int error = readLinePosition() - 3500;   // 0..7000, centre = 3500
      integral += error;
      int correction = Kp * error + Ki * integral + Kd * (error - lastError);
      lastError = error;
    
      // Slow down when we are far off the line; speed up on the straights.
      int speed = baseSpeed - min(abs(error) / 40, 60);
      setMotors(speed + correction, speed - correction);
    }
  • Sneha Rai

    Sneha RaiMember

    @sneha_codes

    Debouncing buttons without delay(), so the rest of the loop keeps running. This replaced about thirty lines of tangled flags in my robot's control code. #code #arduino
    arduino
    // Non-blocking debounce — no delay(), the loop stays responsive.
    class Button {
      uint8_t pin; bool stable = HIGH, last = HIGH; unsigned long changedAt = 0;
    public:
      explicit Button(uint8_t p) : pin(p) { pinMode(p, INPUT_PULLUP); }
    
      // Returns true once per physical press.
      bool pressed() {
        bool now = digitalRead(pin);
        if (now != last) { last = now; changedAt = millis(); }
        if (millis() - changedAt > 25 && now != stable) {
          stable = now;
          return stable == LOW;       // active-low with INPUT_PULLUP
        }
        return false;
      }
    };

Trending this month

Busiest spaces

Browse all spaces

Posting here

  • Share builds, photos, video, code and what went wrong.
  • Credit the guide or maker you learned from.
  • Keep it safe — no mains wiring advice without warnings.
  • Be kind. Everyone here started at their first blinking LED.