user61637: hi i am getting this error, im guessing i have a bracket missing or one in the wrong place.  any help is appreciate, still new at this. thank you
(code bellow)
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <XBOXRECV.h>

Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);

USB Usb;
XBOXRECV Xbox(&Usb);




// our servo # counter
// You can change the value from 0 to 15 (servo 1 through 16)
uint8_t util1servo = 0;
uint8_t util2servo = 1;
uint8_t ldoorservo = 2;
uint8_t rdoorservo = 7;
uint8_t sdoorservo = 3;
uint8_t mdoorservo = 8;

//Servo limits definition. 
//You will have to figure out which numbers match your servo be carefull with these,
//it can break your servo if you go beyond the limits. The ones listed here are for my own setup
#define UTIL1MIN  150 // Close position of the Top Utility arm
#define UTIL1MAX  310 // Open position of the Top Utility arm
#define UTIL2MIN  140 // Close position of the Bottom Utility arm
#define UTIL2MAX  300 // Open position of the Bottom Utility arm
#define LDOORMIN  390 // Close position of the Left door
#define LDOORMAX  550 // Open position of the Left door
#define RDOORMIN  555 // Close position of the Right door
#define RDOORMAX  360 // Open position of the Right door 
#define SDOORMIN  492 // Close position of the Small door
#define SDOORMAX  200 // Open position of the Small door
#define MDOORMIN  550 // Close position of the Mid door
#define MDOORMAX  380 // Open position of the Mid door

//Status for each door open/close
int LDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int RDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int SDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int MDOORSTATUS = 0; // Status 0 = Closed, 1 = Open




void setup() {

   pwm1.begin();

  pwm1.setPWMFreq(60);  // Analog servos run at ~60 Hz updates

  Wire.begin();

}

void loop() {


//Left door
if (Xbox.getButtonClick(LEFT, 0)){
  if (Xbox.getButtonPress(R1, 0)) {
    if(LDOORSTATUS == 0){
          for (uint16_t lpulselen = LDOORMIN; lpulselen < LDOORMAX; lpulselen++){
          pwm1.setPWM(ldoorservo, 0, lpulselen); //Open the door
          delay(1);
          }
          LDOORSTATUS = 1;
          }
        else if (LDOORSTATUS == 1){ 
             for (uint16_t lpulselen = LDOORMAX; lpulselen > LDOORMIN; lpulselen--){
             pwm1.setPWM(ldoorservo, 0, lpulselen); //Close the door
             delay(1);
             }
             LDOORSTATUS = 0;     
     }


user313: Auto-formatting produced the following - look at your loop() function and you'll see the problem:
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <XBOXRECV.h>

Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);

USB Usb;
XBOXRECV Xbox(&Usb);




// our servo # counter
// You can change the value from 0 to 15 (servo 1 through 16)
uint8_t util1servo = 0;
uint8_t util2servo = 1;
uint8_t ldoorservo = 2;
uint8_t rdoorservo = 7;
uint8_t sdoorservo = 3;
uint8_t mdoorservo = 8;

//Servo limits definition.
//You will have to figure out which numbers match your servo be carefull with these,
//it can break your servo if you go beyond the limits. The ones listed here are for my own setup
#define UTIL1MIN  150 // Close position of the Top Utility arm
#define UTIL1MAX  310 // Open position of the Top Utility arm
#define UTIL2MIN  140 // Close position of the Bottom Utility arm
#define UTIL2MAX  300 // Open position of the Bottom Utility arm
#define LDOORMIN  390 // Close position of the Left door
#define LDOORMAX  550 // Open position of the Left door
#define RDOORMIN  555 // Close position of the Right door
#define RDOORMAX  360 // Open position of the Right door 
#define SDOORMIN  492 // Close position of the Small door
#define SDOORMAX  200 // Open position of the Small door
#define MDOORMIN  550 // Close position of the Mid door
#define MDOORMAX  380 // Open position of the Mid door

//Status for each door open/close
int LDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int RDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int SDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int MDOORSTATUS = 0; // Status 0 = Closed, 1 = Open




void setup() {

  pwm1.begin();

  pwm1.setPWMFreq(60);  // Analog servos run at ~60 Hz updates

  Wire.begin();

}

void loop() {


  //Left door
  if (Xbox.getButtonClick(LEFT, 0)) {
    if (Xbox.getButtonPress(R1, 0)) {
      if (LDOORSTATUS == 0) {
        for (uint16_t lpulselen = LDOORMIN; lpulselen < LDOORMAX; lpulselen++) {
          pwm1.setPWM(ldoorservo, 0, lpulselen); //Open the door
          delay(1);
        }
        LDOORSTATUS = 1;
      }
      else if (LDOORSTATUS == 1) {
        for (uint16_t lpulselen = LDOORMAX; lpulselen > LDOORMIN; lpulselen--) {
          pwm1.setPWM(ldoorservo, 0, lpulselen); //Close the door
          delay(1);
        }
        LDOORSTATUS = 0;
      }


61637: <p>hi i am getting this error, im guessing i have a bracket missing or one in the wrong place.  any help is appreciate, still new at this. thank you</p>

<p>(code bellow)</p>

<pre><code>#include &lt;Wire.h&gt;
#include &lt;Adafruit_PWMServoDriver.h&gt;
#include &lt;XBOXRECV.h&gt;

Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);

USB Usb;
XBOXRECV Xbox(&amp;Usb);




// our servo # counter
// You can change the value from 0 to 15 (servo 1 through 16)
uint8_t util1servo = 0;
uint8_t util2servo = 1;
uint8_t ldoorservo = 2;
uint8_t rdoorservo = 7;
uint8_t sdoorservo = 3;
uint8_t mdoorservo = 8;

//Servo limits definition. 
//You will have to figure out which numbers match your servo be carefull with these,
//it can break your servo if you go beyond the limits. The ones listed here are for my own setup
#define UTIL1MIN  150 // Close position of the Top Utility arm
#define UTIL1MAX  310 // Open position of the Top Utility arm
#define UTIL2MIN  140 // Close position of the Bottom Utility arm
#define UTIL2MAX  300 // Open position of the Bottom Utility arm
#define LDOORMIN  390 // Close position of the Left door
#define LDOORMAX  550 // Open position of the Left door
#define RDOORMIN  555 // Close position of the Right door
#define RDOORMAX  360 // Open position of the Right door 
#define SDOORMIN  492 // Close position of the Small door
#define SDOORMAX  200 // Open position of the Small door
#define MDOORMIN  550 // Close position of the Mid door
#define MDOORMAX  380 // Open position of the Mid door

//Status for each door open/close
int LDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int RDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int SDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int MDOORSTATUS = 0; // Status 0 = Closed, 1 = Open




void setup() {

   pwm1.begin();

  pwm1.setPWMFreq(60);  // Analog servos run at ~60 Hz updates

  Wire.begin();

}

void loop() {


//Left door
if (Xbox.getButtonClick(LEFT, 0)){
  if (Xbox.getButtonPress(R1, 0)) {
    if(LDOORSTATUS == 0){
          for (uint16_t lpulselen = LDOORMIN; lpulselen &lt; LDOORMAX; lpulselen++){
          pwm1.setPWM(ldoorservo, 0, lpulselen); //Open the door
          delay(1);
          }
          LDOORSTATUS = 1;
          }
        else if (LDOORSTATUS == 1){ 
             for (uint16_t lpulselen = LDOORMAX; lpulselen &gt; LDOORMIN; lpulselen--){
             pwm1.setPWM(ldoorservo, 0, lpulselen); //Close the door
             delay(1);
             }
             LDOORSTATUS = 0;     
     }
</code></pre>
 313: <p>Auto-formatting produced the following - look at your <code>loop()</code> function and you'll see the problem:</p>

<pre><code>#include &lt;Wire.h&gt;
#include &lt;Adafruit_PWMServoDriver.h&gt;
#include &lt;XBOXRECV.h&gt;

Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);

USB Usb;
XBOXRECV Xbox(&amp;Usb);




// our servo # counter
// You can change the value from 0 to 15 (servo 1 through 16)
uint8_t util1servo = 0;
uint8_t util2servo = 1;
uint8_t ldoorservo = 2;
uint8_t rdoorservo = 7;
uint8_t sdoorservo = 3;
uint8_t mdoorservo = 8;

//Servo limits definition.
//You will have to figure out which numbers match your servo be carefull with these,
//it can break your servo if you go beyond the limits. The ones listed here are for my own setup
#define UTIL1MIN  150 // Close position of the Top Utility arm
#define UTIL1MAX  310 // Open position of the Top Utility arm
#define UTIL2MIN  140 // Close position of the Bottom Utility arm
#define UTIL2MAX  300 // Open position of the Bottom Utility arm
#define LDOORMIN  390 // Close position of the Left door
#define LDOORMAX  550 // Open position of the Left door
#define RDOORMIN  555 // Close position of the Right door
#define RDOORMAX  360 // Open position of the Right door 
#define SDOORMIN  492 // Close position of the Small door
#define SDOORMAX  200 // Open position of the Small door
#define MDOORMIN  550 // Close position of the Mid door
#define MDOORMAX  380 // Open position of the Mid door

//Status for each door open/close
int LDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int RDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int SDOORSTATUS = 0; // Status 0 = Closed, 1 = Open
int MDOORSTATUS = 0; // Status 0 = Closed, 1 = Open




void setup() {

  pwm1.begin();

  pwm1.setPWMFreq(60);  // Analog servos run at ~60 Hz updates

  Wire.begin();

}

void loop() {


  //Left door
  if (Xbox.getButtonClick(LEFT, 0)) {
    if (Xbox.getButtonPress(R1, 0)) {
      if (LDOORSTATUS == 0) {
        for (uint16_t lpulselen = LDOORMIN; lpulselen &lt; LDOORMAX; lpulselen++) {
          pwm1.setPWM(ldoorservo, 0, lpulselen); //Open the door
          delay(1);
        }
        LDOORSTATUS = 1;
      }
      else if (LDOORSTATUS == 1) {
        for (uint16_t lpulselen = LDOORMAX; lpulselen &gt; LDOORMIN; lpulselen--) {
          pwm1.setPWM(ldoorservo, 0, lpulselen); //Close the door
          delay(1);
        }
        LDOORSTATUS = 0;
      }
</code></pre>
