Moving Halloween pumpkin! 👁️👁️👁️multiple eyes👁️👁️👁️

Поділитися
Вставка
  • Опубліковано 2 жов 2024

КОМЕНТАРІ • 9

  • @Solipsfilm
    @Solipsfilm  11 місяців тому +2

    Hi all,
    Here's the code for the project:
    #include
    Servo servos[12];
    unsigned long lastFastMoveTime = 0;
    bool fastMoveActive = false;
    void centerServos() {
    for (int i = 0; i < 12; i++) {
    servos[i].write(90); // Center each servo to 90 degrees
    }
    delay(3000); // Wait for 1 second after centering servos
    }
    void setup() {
    for (int i = 0; i < 12; i++) {
    servos[i].attach(i + 2); // Attach each servo to a pin (pins 2 to 13)
    }

    randomSeed(analogRead(0)); // Seed the random number generator with an analog pin's value

    centerServos(); // Center the servos upon startup
    }
    void loop() {
    unsigned long currentTime = millis();

    // Check if it's time to activate fast servo movements
    if (!fastMoveActive && (currentTime - lastFastMoveTime >= random(60000, 120000))) {
    delay(3000); // Delay for 3 seconds before starting fast movements

    fastMoveActive = true;
    lastFastMoveTime = currentTime;

    // Move all servos fast and randomly for 8 seconds
    unsigned long fastMoveEndTime = currentTime + 8000;
    while (millis() < fastMoveEndTime) {
    for (int i = 0; i < 12; i++) {
    servos[i].write(random(0, 180));
    }
    }

    fastMoveActive = false;
    }

    // If fastMoveActive is false, continue with normal random movements
    if (!fastMoveActive) {
    int randomDelay = random(300, 1200); // Generate a random delay between movements (faster)
    delay(randomDelay); // Wait for a random amount of time before the next movement

    // Move each servo to a random position within its range
    for (int i = 0; i < 12; i++) {
    servos[i].write(random(0, 180));
    }
    }
    }

  • @zoeyzhang9866
    @zoeyzhang9866 7 місяців тому

    So interesting project it is! Wondering if any custom PCBs and 3D printing services may help for upcoming projects? Would love to sponsor!! (PCBWay zoey)

  • @PrivateJoki
    @PrivateJoki 11 місяців тому +1

    Really nice work ❤

  • @Gensmyawk
    @Gensmyawk 11 місяців тому +1

    1st 😁😁

    • @Solipsfilm
      @Solipsfilm  11 місяців тому

      No, I was first 😆

  • @kattyhubrecht7940
    @kattyhubrecht7940 11 місяців тому

    Really nice , worth tot look

  • @FrankMaertens
    @FrankMaertens 11 місяців тому

    Very special

  • @isadoracashett2233
    @isadoracashett2233 10 місяців тому

    Promo*SM