Exit status 1 Compilation error: #include expects "FILENAME" or <FILENAME>

I am currently working on making a Audio Spectrum Visualizer Analyzer using a MAX219 LED matrix. However I ran into a problem with my code on line 3. It said:

exit status 1

Compilation error: #include expects "FILENAME" or <FILENAME

Anyone know what I did wrong?

#include <arduinoFFT.h>
#include <MD_MAX72xx.h>
#include
  <SPI.h>

#define SAMPLES 64            //Must be a power of 2
#define HARDWARE_TYPE
  MD_MAX72XX::FC16_HW   // Set display type  so that  MD_MAX72xx library treets it
  properly
#define MAX_DEVICES  4   // Total number display modules
#define
  CLK_PIN   13  // Clock pin to communicate with display
#define DATA_PIN  11  //
  Data pin to communicate with display
#define CS_PIN    10  // Control pin to
  communicate with display
#define  xres 32      // Total number of  columns in
  the display, must be <= SAMPLES/2
#define  yres 8       // Total number of  rows
  in the display


int MY_ARRAY[]={0, 128, 192, 224, 240, 248, 252, 254,
  255}; // default = standard pattern
int MY_MODE_1[]={0, 128, 192, 224, 240, 248,
  252, 254, 255}; // standard pattern
int MY_MODE_2[]={0, 128, 64, 32, 16, 8, 4,
  2, 1}; // only peak pattern
int MY_MODE_3[]={0, 128, 192, 160, 144, 136, 132,
  130, 129}; // only peak +  bottom point
int MY_MODE_4[]={0, 128, 192, 160, 208,
  232, 244, 250, 253}; // one gap in the top , 3rd light onwards
int MY_MODE_5[]={0,
  1, 3, 7, 15, 31, 63, 127, 255}; // standard pattern, mirrored vertically


  
double vReal[SAMPLES];
double vImag[SAMPLES];
char data_avgs[xres];

int
  yvalue;
int displaycolumn , displayvalue;
int peaks[xres];
const int buttonPin
  = 5;    // the number of the pushbutton pin
int state = HIGH;             //
  the current reading from the input pin
int previousState = LOW;   // the previous
  reading from the input pin
int displaymode = 1;
unsigned long lastDebounceTime
  = 0;  // the last time the output pin was toggled
unsigned long debounceDelay
  = 50;    // the debounce time; increase if the output flickers


MD_MAX72XX
  mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);   // display object
arduinoFFT
  FFT = arduinoFFT();                                    // FFT object
 


void
  setup() {
    
    ADCSRA = 0b11100101;      // set ADC to free running mode
  and set pre-scalar to 32 (0xe5)
    ADMUX = 0b00000000;       // use pin A0 and
  external voltage reference
    pinMode(buttonPin, INPUT);
    mx.begin();
           // initialize display
    delay(50);            // wait to get reference
  voltage stabilized
}
 
void loop() {
   // ++ Sampling
   for(int
  i=0; i<SAMPLES; i++)
    {
      while(!(ADCSRA & 0x10));        // wait for
  ADC to complete current conversion ie ADIF bit set
      ADCSRA = 0b11110101
  ;               // clear ADIF bit so that ADC can do next operation (0xf5)
      int
  value = ADC - 512 ;                 // Read from ADC and subtract DC offset caused
  value
      vReal[i]= value/8;                      // Copy to bins after compressing

      vImag[i] = 0;                         
    }
    // -- Sampling


  
    // ++ FFT
    FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);

    FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);
    FFT.ComplexToMagnitude(vReal,
  vImag, SAMPLES);
    // -- FFT

    
    // ++ re-arrange FFT result
  to match with no. of columns on display ( xres )
    int step = (SAMPLES/2)/xres;
  
    int c=0;
    for(int i=0; i<(SAMPLES/2); i+=step)  
    {
      data_avgs[c]
  = 0;
      for (int k=0 ; k< step ; k++) {
          data_avgs[c] = data_avgs[c]
  + vReal[i+k];
      }
      data_avgs[c] = data_avgs[c]/step; 
      c++;

    }
    // -- re-arrange FFT result to match with no. of columns on display
  ( xres )

    
    // ++ send to display according measured value 

    for(int i=0; i<xres; i++)
    {
      data_avgs[i] = constrain(data_avgs[i],0,80);
            // set max & min values for buckets
      data_avgs[i] = map(data_avgs[i],
  0, 80, 0, yres);        // remap averaged values to yres
      yvalue=data_avgs[i];


      peaks[i] = peaks[i]-1;    // decay by one light
      if (yvalue > peaks[i])
  
          peaks[i] = yvalue ;
      yvalue = peaks[i];    
      displayvalue=MY_ARRAY[yvalue];

      displaycolumn=31-i;
      mx.setColumn(displaycolumn, displayvalue);              //
  for left to right
     }
     // -- send to display according measured value
  
     
    displayModeChange ();         // check if button pressed to change
  display mode
} 

void displayModeChange() {
  int reading = digitalRead(buttonPin);

  if (reading == HIGH && previousState == LOW && millis() - lastDebounceTime > debounceDelay)
  // works only when pressed
  
  {

   switch (displaymode) {
    case
  1:    //       move from mode 1 to 2
      displaymode = 2;
      for (int
  i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_2[i];
      }
      break;

    case 2:    //       move from mode 2 to 3
      displaymode = 3;
      for
  (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_3[i];
      }
      break;

    case 3:    //     move from mode 3 to 4
      displaymode = 4;
      for
  (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_4[i];
      }
      break;

    case 4:    //     move from mode 4 to 5
      displaymode = 5;
      for
  (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_5[i];
      }
      break;

    case 5:    //      move from mode 5 to 1
      displaymode = 1;      

      for (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_1[i];
      }

      break;
  }

    lastDebounceTime = millis();
  }
  previousState
  = reading;
}


Needs to be all on the same line.

Same applies to the #define. Unlike other source code, preprocessor statements need to be one line.

Technically, you can join lines using backslash, but I really would not recommend that unless you need to.

1 Like

The C/C++ language itself doesn't care about newlines or spacing. But #define and #include are implemented by the "C preprocessor" which is much less intelligent.

I put the #include and #define on the same line and it gave me this error:

/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:41:15: error: 'FC16_HW' in 'class MD_MAX72XX' does not name a type
   MD_MAX72XX::FC16_HW   // Set display type  so that  MD_MAX72xx library treets it
               ^~~~~~~
In file included from /private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:35:0:
/Users/jonahdedini/Documents/Arduino/libraries/MD_MAX72XX/src/MD_MAX72xx.h:368:5: note: 'FC16_HW' declared here
     FC16_HW,      ///< Use FC-16 style hardware module.
     ^~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:82:3: error: 'the' does not name a type; did you mean 'tone'?
   the current reading from the input pin
   ^~~
   tone
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:84:3: error: 'reading' does not name a type; did you mean 'rewind'?
   reading from the input pin
   ^~~~~~~
   rewind
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:93:18: error: expected primary-expression before '(' token
   mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);   // display object
                  ^
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:93:32: error: expected primary-expression before ',' token
   mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);   // display object
                                ^
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino: In function 'void setup()':
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:103:11: error: expected ';' before 'pre'
   and set pre-scalar to 32 (0xe5)
           ^~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:105:3: error: 'external' was not declared in this scope
   external voltage reference
   ^~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:105:3: note: suggested alternative: 'extern'
   external voltage reference
   ^~~~~~~~
   extern
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:110:3: error: 'voltage' was not declared in this scope
   voltage stabilized
   ^~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:103:7: error: label 'set' used but not defined
   and set pre-scalar to 32 (0xe5)
       ^~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino: In function 'void loop()':
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:119:7: error: expected ';' before 'to'
   ADC to complete current conversion ie ADIF bit set
       ^~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:125:7: error: expected ';' before 'vReal'
       vReal[i]= value/8;                      // Copy to bins after compressing
       ^~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:143:3: error: 'to' was not declared in this scope
   to match with no. of columns on display ( xres )
   ^~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:147:36: error: 'step' was not declared in this scope
     for(int i=0; i<(SAMPLES/2); i+=step)
                                    ^~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:147:36: note: suggested alternative: 'setup'
     for(int i=0; i<(SAMPLES/2); i+=step)
                                    ^~~~
                                    setup
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:165:5: error: expected ';' before 'for'
     for(int i=0; i<xres; i++)
     ^~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:165:18: error: 'i' was not declared in this scope
     for(int i=0; i<xres; i++)
                  ^
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:189:3: error: 'display' was not declared in this scope
   display mode
   ^~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:189:3: note: suggested alternative: 'delay'
   display mode
   ^~~~~~~
   delay
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino: In function 'void displayModeChange()':
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:195:26: error: 'previousState' was not declared in this scope
   if (reading == HIGH && previousState == LOW && millis() - lastDebounceTime > debounceDelay)
                          ^~~~~~~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:200:12: error: 'displaymode' was not declared in this scope
    switch (displaymode) {
            ^~~~~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:200:12: note: suggested alternative: 'displayvalue'
    switch (displaymode) {
            ^~~~~~~~~~~
            displayvalue
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:206:9: error: 'MY_ARRAY' was not declared in this scope
         MY_ARRAY[i]=MY_MODE_2[i];
         ^~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:214:9: error: 'MY_ARRAY' was not declared in this scope
         MY_ARRAY[i]=MY_MODE_3[i];
         ^~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:222:9: error: 'MY_ARRAY' was not declared in this scope
         MY_ARRAY[i]=MY_MODE_4[i];
         ^~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:230:9: error: 'MY_ARRAY' was not declared in this scope
         MY_ARRAY[i]=MY_MODE_5[i];
         ^~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:238:9: error: 'MY_ARRAY' was not declared in this scope
         MY_ARRAY[i]=MY_MODE_1[i];
         ^~~~~~~~
/private/var/folders/pb/fgrmhcz12sn8klk653ryn9bw0000gn/T/.arduinoIDE-unsaved2024012-11107-1vyyuor.ffq1/sketch_jan12a/sketch_jan12a.ino:246:3: error: 'previousState' was not declared in this scope
   previousState
   ^~~~~~~~~~~~~

exit status 1

Compilation error: 'FC16_HW' in 'class MD_MAX72XX' does not name a type

Post the code that created those errors. It looks like you have a bunch of syntax errors or you still didn't write the #include line correctly.

#include <arduinoFFT.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
  

#define SAMPLES 64            //Must be a power of 2
#define HARDWARE_TYPE
  MD_MAX72XX::FC16_HW   // Set display type  so that  MD_MAX72xx library treets it
  properly
#define MAX_DEVICES  4   // Total number display modules
#define CLK_PIN   13
    // Clock pin to communicate with display
#define DATA_PIN  11  //
  Data pin to communicate with display
#define CS_PIN    10  // Control pin to
  communicate with display
#define  xres 32      // Total number of  columns in
  the display, must be <= SAMPLES/2
#define  yres 8       // Total number of  rows
  in the display


int MY_ARRAY[]={0, 128, 192, 224, 240, 248, 252, 254,
  255}; // default = standard pattern
int MY_MODE_1[]={0, 128, 192, 224, 240, 248,
  252, 254, 255}; // standard pattern
int MY_MODE_2[]={0, 128, 64, 32, 16, 8, 4,
  2, 1}; // only peak pattern
int MY_MODE_3[]={0, 128, 192, 160, 144, 136, 132,
  130, 129}; // only peak +  bottom point
int MY_MODE_4[]={0, 128, 192, 160, 208,
  232, 244, 250, 253}; // one gap in the top , 3rd light onwards
int MY_MODE_5[]={0,
  1, 3, 7, 15, 31, 63, 127, 255}; // standard pattern, mirrored vertically


  
double vReal[SAMPLES];
double vImag[SAMPLES];
char data_avgs[xres];

int
  yvalue;
int displaycolumn , displayvalue;
int peaks[xres];
const int buttonPin
  = 5;    // the number of the pushbutton pin
int state = HIGH;             //
  the current reading from the input pin
int previousState = LOW;   // the previous
  reading from the input pin
int displaymode = 1;
unsigned long lastDebounceTime
  = 0;  // the last time the output pin was toggled
unsigned long debounceDelay
  = 50;    // the debounce time; increase if the output flickers


MD_MAX72XX
  mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);   // display object
arduinoFFT
  FFT = arduinoFFT();                                    // FFT object
 


void
  setup() {
    
    ADCSRA = 0b11100101;      // set ADC to free running mode
  and set pre-scalar to 32 (0xe5)
    ADMUX = 0b00000000;       // use pin A0 and
  external voltage reference
    pinMode(buttonPin, INPUT);
    mx.begin();
           // initialize display
    delay(50);            // wait to get reference
  voltage stabilized
}
 
void loop() {
   // ++ Sampling
   for(int
  i=0; i<SAMPLES; i++)
    {
      while(!(ADCSRA & 0x10));        // wait for
  ADC to complete current conversion ie ADIF bit set
      ADCSRA = 0b11110101
  ;               // clear ADIF bit so that ADC can do next operation (0xf5)
      int
  value = ADC - 512 ;                 // Read from ADC and subtract DC offset caused
  value
      vReal[i]= value/8;                      // Copy to bins after compressing

      vImag[i] = 0;                         
    }
    // -- Sampling


  
    // ++ FFT
    FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);

    FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);
    FFT.ComplexToMagnitude(vReal,
  vImag, SAMPLES);
    // -- FFT

    
    // ++ re-arrange FFT result
  to match with no. of columns on display ( xres )
    int step = (SAMPLES/2)/xres;
  
    int c=0;
    for(int i=0; i<(SAMPLES/2); i+=step)  
    {
      data_avgs[c]
  = 0;
      for (int k=0 ; k< step ; k++) {
          data_avgs[c] = data_avgs[c]
  + vReal[i+k];
      }
      data_avgs[c] = data_avgs[c]/step; 
      c++;

    }
    // -- re-arrange FFT result to match with no. of columns on display
  ( xres )

    
    // ++ send to display according measured value 

    for(int i=0; i<xres; i++)
    {
      data_avgs[i] = constrain(data_avgs[i],0,80);
            // set max & min values for buckets
      data_avgs[i] = map(data_avgs[i],
  0, 80, 0, yres);        // remap averaged values to yres
      yvalue=data_avgs[i];


      peaks[i] = peaks[i]-1;    // decay by one light
      if (yvalue > peaks[i])
  
          peaks[i] = yvalue ;
      yvalue = peaks[i];    
      displayvalue=MY_ARRAY[yvalue];

      displaycolumn=31-i;
      mx.setColumn(displaycolumn, displayvalue);              //
  for left to right
     }
     // -- send to display according measured value
  
     
    displayModeChange ();         // check if button pressed to change
  display mode
} 

void displayModeChange() {
  int reading = digitalRead(buttonPin);

  if (reading == HIGH && previousState == LOW && millis() - lastDebounceTime > debounceDelay)
  // works only when pressed
  
  {

   switch (displaymode) {
    case
  1:    //       move from mode 1 to 2
      displaymode = 2;
      for (int
  i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_2[i];
      }
      break;

    case 2:    //       move from mode 2 to 3
      displaymode = 3;
      for
  (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_3[i];
      }
      break;

    case 3:    //     move from mode 3 to 4
      displaymode = 4;
      for
  (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_4[i];
      }
      break;

    case 4:    //     move from mode 4 to 5
      displaymode = 5;
      for
  (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_5[i];
      }
      break;

    case 5:    //      move from mode 5 to 1
      displaymode = 1;      

      for (int i=0 ; i<=8 ; i++ ) {
        MY_ARRAY[i]=MY_MODE_1[i];
      }

      break;
  }

    lastDebounceTime = millis();
  }
  previousState
  = reading;
}


No. Where did you get this code? This all goes on one line. The "properly" is part of that comment above it. When it gets put on its own line like this then the compiler thinks you intended it to be code. It doesn't make sense as code so it throws an error.

You may want to take an hour or two and look at some basic C++ tutorials and see if you can try to understand the syntax just a little. This will be a frustrating journey without knowing that.

Go through your code and find all the places where you broke a line up like this and fix them.

It looks like someone went through your code just willy-nilly hitting the return key. What happened?

Sorry I am a beginner. I am just trying to figure out what is going on wrong.

Yeah, the source code on that page is pretty messed up. Like I said, it looks like someone just went through randomly hitting the return key. Or maybe some non-programmer wanted to make it fit int he window nicer. Either way, that code is all wrong. You'll have to fix all those #define statements and comments at the very least.

I used a different code and it compiled successfully. when I sent it to my Arduino it said this:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Failed uploading: uploading error: exit status 1

That's a common error. It means that the board isn't responding to the Arduino IDE when it tries to program it. There are a number of possible causes. Google "avrdude: stk500_recv(): programmer is not responding" and you should see a laundry list of things to check.

Thank you se much! I got it to work!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.