Trouble code from nano to every

having trouble converting from nano to the every for an ironman helmet

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

#define SERVOMIN 150
#define SERVOMAX 450
#define SERVO_FREQ 50

int buttonPin = 2; // Button pin
int ledPin = 6;    // LED pin
int buttonState = HIGH;
int lastButtonState = HIGH; // Previous state of the button
unsigned long lastDebounceTime = 0; // Button debounce time
unsigned long debounceDelay = 50;   // Delay for debouncing
int globalPos = 1; // 1 = Closed, 0 = Open

uint8_t records[7] = {0, 1}; // Indices for "open" (0) and "close" (1)
uint8_t buf[64];            // Buffer for recognized commands

void setup() {
  Serial.begin(9600);
  Serial.println("starting system");
  pwm.begin();
  pwm.setOscillatorFrequency(27000000);
  pwm.setPWMFreq(SERVO_FREQ);

  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);

  pwm.sleep(); // The controller is suspended at startup.
  digitalWrite(ledPin, HIGH); // Make sure the LEDs are on at the beginning (helmet closed).
  
  // Initial configuration of the servos to prevent erratic movements.
  pwm.setPWM(0, 0, getAngleToPulse(750)); // Initial position Servo 0
  pwm.setPWM(1, 0, getAngleToPulse(750)); // Initial position Servo 1
}

int getAngleToPulse(int angle) {
  return map(angle, 0, 180, SERVOMIN, SERVOMAX);
}

void openHelmet() {
  Serial.println("Opening the helmet...");
  pwm.wakeup();
  digitalWrite(ledPin, LOW); // Turn off the LEDs when opening.

  // Cheek movement
  for (uint16_t pulselen = 90; pulselen >= 20; pulselen--) {
    pwm.setPWM(9, 0, getAngleToPulse(90 + 20 - pulselen));
    pwm.setPWM(8, 0, getAngleToPulse(pulselen));
  }

  // Movement of the sides of the nose
  for (uint16_t pulselen = 86; pulselen >= 10; pulselen--) {
    pwm.setPWM(6, 0, getAngleToPulse(86 + 10 - pulselen));
    pwm.setPWM(7, 0, getAngleToPulse(pulselen));
  }

  // Movement of the central eyebrow
  for (uint16_t pulselen = 120; pulselen >= 40; pulselen--) {
    pwm.setPWM(4, 0, getAngleToPulse(pulselen));
  }

  // Movement of the lateral eyebrows
  for (uint16_t pulselen = 30; pulselen <= 90; pulselen++) {
    pwm.setPWM(2, 0, getAngleToPulse(pulselen));
    pwm.setPWM(3, 0, getAngleToPulse(30 + 90 - pulselen));
  }

  // Movement of the center of the nose
  for (uint16_t pulselen = 110; pulselen >= 1; pulselen--) {
    pwm.setPWM(5, 0, getAngleToPulse(pulselen));
  }

  // Movement of the main engines
  for (uint16_t microsec = 750; microsec < 1950; microsec += 5) {
    pwm.writeMicroseconds(0, microsec);         // Left engine (Servo 0)
    pwm.writeMicroseconds(1, 1950 + 750 - microsec); // Right motor (Servo 1)
  }

  Serial.println("Open helmet.");
}

void closehelmet() {
  Serial.println("Closing the helmet...");
  pwm.wakeup();
  digitalWrite(ledPin, HIGH); // Turn on the LEDs when closing.

  // Movement of the main engines
  for (uint16_t microsec = 1950; microsec > 750; microsec -= 5) {
    pwm.writeMicroseconds(0, microsec);         // Left engine (Servo 0)
    pwm.writeMicroseconds(1, 1950 + 750 - microsec); // Right engine (Servo 1)
  }

  // Movement of the center of the nose
  for (uint16_t pulselen = 1; pulselen <= 110; pulselen++) {
    pwm.setPWM(5, 0, getAngleToPulse(pulselen));
  }

  // Movement of the lateral eyebrows
  for (uint16_t pulselen = 90; pulselen >= 30; pulselen--) {
    pwm.setPWM(2, 0, getAngleToPulse(pulselen));
    pwm.setPWM(3, 0, getAngleToPulse(30 + 90 - pulselen));
  }

  // Movement of the central eyebrow
  for (uint16_t pulselen = 40; pulselen <= 120; pulselen++) {
    pwm.setPWM(4, 0, getAngleToPulse(pulselen));
  }

  // Movement of the sides of the nose
  for (uint16_t pulselen = 10; pulselen <= 86; pulselen++) {
    pwm.setPWM(6, 0, getAngleToPulse(86 + 10 - pulselen));
    pwm.setPWM(7, 0, getAngleToPulse(pulselen));
  }

  // Cheek movement
  for (uint16_t pulselen = 20; pulselen <= 90; pulselen++) {
    pwm.setPWM(9, 0, getAngleToPulse(90 + 20 - pulselen));
    pwm.setPWM(8, 0, getAngleToPulse(pulselen));
  }

  Serial.println("Closed helmet.");
}

void loop() {
  // Debounce for the button
  int reading = digitalRead(buttonPin);
  if (reading != lastButtonState) {
    lastDebounceTime = millis();
  }

  if ((millis() - lastDebounceTime) > debounceDelay) {
    if (reading == LOW && globalPos == 1) { // Button to open
      globalPos = 0;
    } else if (reading == LOW && globalPos == 0) { // Button to close
      globalPos = 1;
    }
  }
  lastButtonState = reading;

  
    }

And what might that trouble be?

The code certainly compiles for a Nano Every.

(post deleted by author)

The servos do not move am looking into some of the other posts and finding more info get stuff worked out, thank you for the reply

You will have to provide a wiring diagram to show how you have connected the Nano Every, the Adafruit board, and the Servos.

Does your iron man helmet setup and code work with an Atmega328 Nano?

The Nano Every should be a plug and play replacement for a Nano V3.

Yes, the only difference is that, unlike Nano V3, for Every the basic Arduino package is not enough, you need to install megaAVR boards package.
https://docs.arduino.cc/software/ide-v1/tutorials/getting-started/cores/arduino-megaavr

I did install the megaavr and have it reading right and using the other processor. I am thinking the problem is is gonna be my soldering job on the 9685 board.
The servos work when hooked directly to the nano every and using the sweep build, am still looking into other posts to figure this out.

this is the diagram, followed it and still no servo action. even went so far as to rewire it twice and picked up new boards. not sure where to look at the moment, any help is appreciated. i have megaAVR, have it switched to the every and the atmega4089 processor ticked and the adafruit pwm servodriver . i dont have atmega328 nano and trying to find a nano v3 is impossible near me, lol also the caps i am using are 2200uf, power is from a powerbank

Can you post a picture of both sides of the board, so we can see the soldering?

That could be a problem. Servos need a lot of current, especially if more than one is moving at a time.

The power bank is 5V 2A 10000mah




If you run the i2c scanner program, do you see the Adafruit board on the bus?

#include <Wire.h>

void setup() {

 //pinMode(A2, OUTPUT);//setup for rtc on A2,A3
 //digitalWrite(A2, LOW);
 //pinMode(A3, OUTPUT);
 //digitalWrite(A3, HIGH);

  Serial.begin (115200);

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;

  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
    {
      Serial.print ("Found address: ");
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
    } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {
}

Vin needs at least 7V on the Nano Every. You cannot wire as you've depicted.