Flora and conductive fabric
Moderators: adafruit_support_bill, adafruit

Flora and conductive fabric

by KimD on Sun Mar 03, 2013 6:44 pm

I'm working with the Capacitive Touch with Conductive Fabric and Flora tutorial, I've copied and pasted the entire sketch into my Arduino window. When I click on "Verify", I get the following errors:

CapacitiveSensorSketch:15: error: 'CapacitiveSensor' does not name a type
CapacitiveSensorSketch.pde: In function 'void setup()':
CapacitiveSensorSketch:22: error: 'cs_9_10' was not declared in this scope
CapacitiveSensorSketch.pde: In function 'void loop()':
CapacitiveSensorSketch:32: error: 'cs_9_10' was not declared in this scope

I've tried adding a type to
CapacitiveSensor cs_9_10 = CapacitiveSensor(9,10);
but this brings up other errors...

I've had success downloading Lux Sensor code and mixing it up with the Flora LED display code, but this one is giving me trouble.
Any ideas??
thanks!
KimD
 
Posts: 4
Joined: Sun Jan 06, 2013 11:48 pm

Re: Flora and conductive fabric

by adafruit_support_bill on Mon Mar 04, 2013 6:43 am

Looks like your Capacitive Sensor library is not installed in the correct location.
http://learn.adafruit.com/adafruit-all- ... nstall-use
User avatar
adafruit_support_bill
 
Posts: 30758
Joined: Sat Feb 07, 2009 10:11 am

Re: Flora and conductive fabric

by KimD on Mon Mar 04, 2013 7:58 pm

Oh my, you're right! I knew it had to be something simple, and I thought I'd had those libraries figured out.

thank you so much.
KimD
 
Posts: 4
Joined: Sun Jan 06, 2013 11:48 pm

Re: Flora and conductive fabric

by agustm on Tue Aug 12, 2014 7:43 am

Hello,
I could not solve this same problem.
I followed the instructions to install the libraries on a Mac, and it does appear on the Examples now. However, I still get the same error:
Any suggestion? Thanks!

CapacitiveSensorSketch:12: error: 'CapacitiveSensor' does not name a type
CapacitiveSensorSketch.pde: In function 'void setup()':
CapacitiveSensorSketch:16: error: 'cs_4_2' was not declared in this scope
CapacitiveSensorSketch.pde: In function 'void loop()':
CapacitiveSensorSketch:23: error: 'cs_4_2' was not declared in this scope
agustm
 
Posts: 4
Joined: Fri Jul 11, 2014 9:18 am

Re: Flora and conductive fabric

by adafruit_support_bill on Tue Aug 12, 2014 7:50 am

Make sure you close all instances of the Arduino IDE and then re-open it. The IDE does not recognize libraries that are installed while it is running.
User avatar
adafruit_support_bill
 
Posts: 30758
Joined: Sat Feb 07, 2009 10:11 am

Re: Flora and conductive fabric

by kristenw on Sat Aug 30, 2014 2:09 am

I've wired the circuit correctly, and I've uploaded the code from

https://learn.adafruit.com/capacitive-t ... flora/code

and I keep getting the error
"RGBPixel does not name a type"
sketch_aug30b.ino:2:33: error: Adafruit_FloraPixel.h: No such file or directory
sketch_aug30b:18: error: 'RGBPixel' does not name a type
sketch_aug30b:18: error: 'Adafruit_FloraPixel' does not name a type
sketch_aug30b.ino: In function 'void setup()':
sketch_aug30b:24: error: 'strip' was not declared in this scope
sketch_aug30b.ino: In function 'void loop()':
sketch_aug30b:38: error: 'strip' was not declared in this scope
sketch_aug30b:38: error: 'Color' was not declared in this scope
sketch_aug30b:41: error: 'strip' was not declared in this scope
sketch_aug30b:41: error: 'Color' was not declared in this scope
sketch_aug30b.ino: At global scope:
sketch_aug30b:58: error: 'RGBPixel' does not name a type


What did I do wrong?
kristenw
 
Posts: 8
Joined: Sat Nov 16, 2013 2:23 pm

Re: Flora and conductive fabric

by adafruit_support_bill on Sat Aug 30, 2014 6:04 am

sketch_aug30b.ino:2:33: error: Adafruit_FloraPixel.h: No such file or directory
sketch_aug30b:18: error: 'RGBPixel' does not name a type

The compiler was not able to find the library in the expected location. Follow the instructions here to make sure that your library is installed correctly.
http://learn.adafruit.com/adafruit-all- ... nstall-use
User avatar
adafruit_support_bill
 
Posts: 30758
Joined: Sat Feb 07, 2009 10:11 am

Re: Flora and conductive fabric

by kristenw on Sat Aug 30, 2014 3:07 pm

Thank you, I went back, deleted my old capacitive sensor libraries, uploaded the new one from the Arduino website, made sure they were in the right location (on my Mac, documents>Arduino>libraries), and did not alter the name beyond changing - to _. I also made certain to quit the IDE program while I did all of this.

It still reads "Capacitive sensor does not name a type" when I compile. I feel like a dunce.
kristenw
 
Posts: 8
Joined: Sat Nov 16, 2013 2:23 pm

Re: Flora and conductive fabric

by adafruit_support_rick on Sat Aug 30, 2014 4:08 pm

Please post the exact error messages. Also run Grab and post a screenshot of the Finder showing your folder structure for the capacitive touch files

adafruit_support_rick
 
Posts: 12793
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Flora and conductive fabric

by kristenw on Sat Aug 30, 2014 5:21 pm

Screen cap.tiff
Screen cap.tiff (536.89 KiB) Viewed 97 times
Screen cap.tiff
Screen cap.tiff (536.89 KiB) Viewed 97 times


The errors are:

'RGBPixel' does not name a type (in the big orange block)
sketch_aug30g.ino:2:33: error: Adafruit_FloraPixel.h: No such file or directory
sketch_aug30g:18: error: 'RGBPixel' does not name a type
sketch_aug30g:18: error: 'Adafruit_FloraPixel' does not name a type
sketch_aug30g.ino: In function 'void setup()':
sketch_aug30g:24: error: 'strip' was not declared in this scope
sketch_aug30g.ino: In function 'void loop()':
sketch_aug30g:38: error: 'strip' was not declared in this scope
sketch_aug30g:38: error: 'Color' was not declared in this scope
sketch_aug30g:41: error: 'strip' was not declared in this scope
sketch_aug30g:41: error: 'Color' was not declared in this scope
sketch_aug30g.ino: At global scope:
sketch_aug30g:58: error: 'RGBPixel' does not name a type


I was able to get the pixel to light with the conductive fabric by using this code from instructables, which worked great:

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#include <CapacitiveSensor.h>

#define PIN 6


// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, PIN, NEO_GRB + NEO_KHZ800);
CapacitiveSensor   cs_9_10 = CapacitiveSensor(9,10); 

void setup() {
  cs_9_10.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an example
  Serial.begin(9600);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  long total1 =  cs_9_10.capacitiveSensor(30);
  Serial.println(total1);

  // Some example procedures showing how to display to the pixels:
  //colorWipe(strip.Color(0, 0, 0), 50); // Red
  //colorWipe(strip.Color(0, 255, 0), 50); // Green
  //colorWipe(strip.Color(0, 0, 255), 50); // Blue
  //rainbow(20);
  //rainbowCycle(20);

  if(total1 <= 50){
    // turn LED on:
    colorWipe(strip.Color(0, 0, 0), 0);   
  }
  else {
    //turn LED off:
    colorWipe(strip.Color(255,255,255), 0);
  }
 
 //Serial.println(total1);
 //delay(100);
}




// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}
kristenw
 
Posts: 8
Joined: Sat Nov 16, 2013 2:23 pm

Re: Flora and conductive fabric

by adafruit_support_rick on Sat Aug 30, 2014 5:32 pm

kristenw wrote:sketch_aug30g.ino:2:33: error: Adafruit_FloraPixel.h: No such file or directory

You have no library named Adafruit_FloraPixel. Your sketch is trying to #include <Adafruit_FloraPixel.h>, and that file does not exist. You need to install that library.

adafruit_support_rick
 
Posts: 12793
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Flora and conductive fabric

by kristenw on Sat Aug 30, 2014 5:47 pm

THANK YOU!!
kristenw
 
Posts: 8
Joined: Sat Nov 16, 2013 2:23 pm



cron