0

using makefile, "was not declared in this scope" error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

using makefile, "was not declared in this scope" error

by jasont on Sat Oct 20, 2018 1:46 am

I am using a makefile to compile and upload to my UNO. I can upload a sketch that using the libraries found in my sketchbook directory.

These sketches are using the Adafruit NeoPixel library.

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, PIN, NEO_GRB + NEO_KHZ800);

void setup(){
  #if defined (__AVR_ATtiny85__)
    if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
  #endif
  strip.begin();
  strip.show();
}

void loop(){
   for(int i=0; i<6; i++){
      for(int j=0; j<100; j++){
         strip.setPixelColor(i,        j, 0, 0);
         strip.setPixelColor((i+6)%12, j, 0, 0);
         strip.show();
         delay(20);
      }
      strip.setPixelColor(i,        0, 0, 0);
      strip.setPixelColor((i+6)%12, 0, 0, 0);
   }
}


This compiles and uploads fine.

When I try to upload a `.ino` file that uses functions that are defined in the source I get scope errors regarding those functions. The `strandtest.ino` example in the Adafruit_Neopixel library throws several errors in regards to the functions that were defined in the source.

Code: Select all | TOGGLE FULL SIZE
strandtest.ino:37:39: error: ‘colorWipe’ was not declared in this scope
   colorWipe(strip.Color(255, 0, 0), 50); // Red
                                       ^


This might be more of a makefile issue, not sure. Thanks!
jasont
 
Posts: 3
Joined: Wed Jul 24, 2013 1:56 pm

Please be positive and constructive with your questions and comments.