Skip to content

Fix trigger timing and Variable Names - #14

Open
captainwerty wants to merge 2 commits into
mainfrom
fix-trigger-timing
Open

Fix trigger timing and Variable Names#14
captainwerty wants to merge 2 commits into
mainfrom
fix-trigger-timing

Conversation

@captainwerty

Copy link
Copy Markdown

Summary

Fixed timing bug where micros() and millis() were mixed, causing inconsistent trigger behavior.
Now uses millis() + 3000UL for a trigger exactly 3 seconds after setup.

Changes

  • Replaced contexspr typo with constexpr
  • Changed trigger_time to unsigned long and initialized it properly
  • Corrected loop logic for the second motor:
    // fire the 2nd motor & legs once, 3s after setup
    if (!legs_triggered && millis() >= trigger_time) {
        legs_triggered = true;
        triggerMotor();
        triggerLegs();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant