help Gemma Color Touch Pendant Necklace HELP!!!

Wearable electronics: boards, conductive materials, and projects from Adafruit!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

Hi I am trying to buld the Gemma Color Touch Pendant Necklace. I am having problems with the code.
when i try to compile the sketch I get this

Arduino: 1.8.2 (Windows 7), Board: "Arduino Gemma"

Build options changed, rebuilding all
In file included from C:\Users\HOME\Documents\Arduino\libraries\Adafruit_FreeTouch_Library/adafruit_ptc.h:33:0,

from C:\Users\HOME\Documents\Arduino\libraries\Adafruit_FreeTouch_Library/Adafruit_FreeTouch.h:4,

from C:\Users\HOME\AppData\Local\Temp\arduino_modified_sketch_335369\sketch_oct27a.ino:9:

C:\Users\HOME\Documents\Arduino\libraries\Adafruit_FreeTouch_Library/samd21_ptc_component.h:31:10: fatal error: sam.h: No such file or directory

#include "sam.h"

^~~~~~~

compilation terminated.

exit status 1
Error compiling for board Arduino Gemma.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


I have no clue what to do please help.

Code: Select all

#include <FastLED.h>

#include <Adafruit_NeoPixel.h>

// Code by Erin St. Blaine for Adafruit Industries
// Color Touch Pendant Tutorial: https://learn.adafruit.com/color-touch-pendant-necklace/introduction
// Two neopixel rings connected on pin 1 will cycle through gradient colors when the pendant is touched.  For Gemma M0.

#include "Adafruit_FreeTouch.h"
#include "FastLED.h"

#define CAPTOUCH_PIN 0  //capacitive touch pin
#define NEOPIXEL_PIN 1  //neopixel ring pin
#define NUM_LEDS    28  //how many pixels total

#define LED_TYPE    WS2812
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];   //LED array

// These variables will affect the way the gradient animation looks.  Feel free to mess with them.
int SPEEDO = 10;
int STEPS = 50;
int HUE = 0;
int SATURATION = 255;
int COLORCHANGE = 50;
int BRIGHTNESS = 110;

// Calibrating your capacitive touch sensitivity: Change this variable to something between your capacitive touch serial readouts for on and off
int touch = 650;

long oldState = 0;

// set up capacitive touch button using the FreeTouch library
Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(CAPTOUCH_PIN, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);


TBlendType    currentBlending;
CRGBPalette16 currentPalette;


void setup() {
  Serial.begin(115200);

  if (! qt_1.begin())
    Serial.println("Failed to begin qt on pin A1");
  FastLED.addLeds<WS2812, NEOPIXEL_PIN, COLOR_ORDER>(leds, NUM_LEDS);  // Set up neopixels with FastLED
  FastLED.setBrightness(BRIGHTNESS); // set global brightness
  FastLED.BANNED(3, 350); //Constrain FastLED's power usage
}

void loop() {

  Serial.print(qt_1.measure());
  Serial.write(' ');
  checkpress();   //check to see if the button's been pressed
  //delay(20);
}

void checkpress() {

  // Get current button state.

  long newState =  qt_1.measure();
  Serial.println(qt_1.measure());
  if (newState > touch && oldState < touch) {
    // Short delay to debounce button.
    delay(500);
    // Check if button is still low after debounce.
    long newState =  qt_1.measure();
  }


  if (newState > touch ) {
    HUE = HUE + COLORCHANGE; // change the hue by a specified amount each time the cap touch pad is activated
    if (HUE > 255) {
      HUE = 0;
    }
    Gradient();
  }
  //  if (HUE==250) {
  //    dark();
  //  }
  else {
    Gradient();

  }



  // Set the last button state to the old state.
  oldState = newState;

}



// GRADIENT --------------------------------------------------------------
void Gradient()
{
  SetupGradientPalette();

  static uint8_t startIndex = 0;
  startIndex = startIndex - 1;  // motion speed

  FillLEDsFromPaletteColors( startIndex);
  FastLED.show();
  FastLED.delay(SPEEDO);
}

// adjust hue, saturation and brightness values here to make a pleasing gradient

void SetupGradientPalette()
{
  CRGB light = CHSV( HUE + 25, SATURATION - 20, BRIGHTNESS);
  CRGB lightmed = CHSV (HUE + 15, SATURATION - 10, BRIGHTNESS - 50);
  CRGB medium = CHSV ( HUE + 10, SATURATION - 15, BRIGHTNESS);
  CRGB dark  = CHSV( HUE, SATURATION, BRIGHTNESS);
  CRGB black = CHSV (HUE, SATURATION, 0);

  currentPalette = CRGBPalette16(
                     black,  light,  light,  light,
                     lightmed, lightmed, lightmed,  medium,
                     medium,  medium,  medium,  dark,
                     dark, dark, dark,  black );
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  uint8_t brightness = BRIGHTNESS;

  for ( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    colorIndex += STEPS;
  }
}

void dark()
{
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Black;
    FastLED.show();
    delay(20);
  }
}

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by adafruit_support_carter »

Just to make sure, do you have a Gemma M0?
https://www.adafruit.com/product/3501
or one of the older original Gemmas?
https://www.adafruit.com/product/1222

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

yes it is a brand new gamma m0

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by adafruit_support_carter »

It looks like you selected the older version board in the Arduio IDE:
Arduino: 1.8.2 (Windows 7), Board: "Arduino Gemma"
Make sure to select Gemma M0. And then try the Blink example just to make sure basic compiling and uploading is working:
https://learn.adafruit.com/adafruit-gem ... 2854174-21

You may also want to upgrade your Arduino IDE since your current version is a few revs old.

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

In file included from C:\Users\HOME\Desktop\pixal pendent\color_touch_pendant\color_touch_pendant.ino:5:0:
C:\Users\HOME\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.000
# pragma message "FastLED version 3.003.000"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\HOME\Documents\Arduino\libraries\FastLED/FastLED.h:65:0,
from C:\Users\HOME\Desktop\pixal pendent\color_touch_pendant\color_touch_pendant.ino:5:
C:\Users\HOME\Documents\Arduino\libraries\FastLED/fastspi.h:130:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output
# pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\HOME\Documents\Arduino\libraries\FastLED/FastLED.h:48:0,
from C:\Users\HOME\Desktop\pixal pendent\color_touch_pendant\color_touch_pendant.ino:5:
C:\Users\HOME\Documents\Arduino\libraries\FastLED/fastpin.h: In instantiation of 'class FastPin<1>':
C:\Users\HOME\Documents\Arduino\libraries\FastLED/fastpin.h:239:29: required from 'class FastPinBB<1>'
C:\Users\HOME\Documents\Arduino\libraries\FastLED/platforms/arm/d21/clockless_arm_d21.h:10:52: required from 'class ClocklessController<1, 12, 30, 18, (EOrder)66, 0, false, 50>'
C:\Users\HOME\Documents\Arduino\libraries\FastLED/chipsets.h:582:7: required from 'class WS2812Controller800Khz<1, (EOrder)66>'
C:\Users\HOME\Documents\Arduino\libraries\FastLED/FastLED.h:103:52: required from 'class WS2812<1, (EOrder)66>'
C:\Users\HOME\Documents\Arduino\libraries\FastLED/FastLED.h:302:39: required from 'static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with CHIPSET = WS2812; unsigned char DATA_PIN = 1; EOrder RGB_ORDER = (EOrder)66]'
C:\Users\HOME\Desktop\pixal pendent\color_touch_pendant\color_touch_pendant.ino:48:69: required from here
C:\Users\HOME\Documents\Arduino\libraries\FastLED/fastpin.h:207:2: error: static assertion failed: Invalid pin specified
static_assert(validpin(), "Invalid pin specified");
^~~~~~~~~~~~~
exit status 1
Error compiling for board Arduino M0.

User avatar
Franklin97355
 
Posts: 23938
Joined: Mon Apr 21, 2008 2:33 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by Franklin97355 »

2020-10-28_20h13_42.png
2020-10-28_20h13_42.png (7.13 KiB) Viewed 354 times
Are you sure you are compiling for the Gemma M0?

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

gamma mo is not on my list
Attachments
gamma.jpg
gamma.jpg (848.38 KiB) Viewed 354 times

User avatar
Franklin97355
 
Posts: 23938
Joined: Mon Apr 21, 2008 2:33 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by Franklin97355 »

Try updating Arduino to the latest version it's 1.8.13 now.

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

Im running 1.8.13

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

can I do the same code threw python and Mu. not that I know how to use that ether.

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by adafruit_support_carter »

Did you install the Adafruit SAMD package?
https://learn.adafruit.com/adafruit-gem ... -2854160-7

User avatar
Rcayot
 
Posts: 321
Joined: Sat Feb 08, 2020 6:48 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by Rcayot »

I have similar problems.

I think that fastled.h library does not support that board. Look on fastled supported boards, and you will not see M0 or M4 boards supported, mostly AVR not much ARM.

https://github.com/FastLED/FastLED/wiki ... #platforms

if I am wrong, please post, because I would REALLY like to use FAASTLED on my project.

Roger

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

adafruit_support_carter wrote:Did you install the Adafruit SAMD package?
https://learn.adafruit.com/adafruit-gem ... -2854160-7
I have every board option that comes up when i surch Adafruit SAMD and still nothing.
Attachments
ada boards.jpg
ada boards.jpg (214.11 KiB) Viewed 327 times

User avatar
mightynova63
 
Posts: 10
Joined: Tue Oct 27, 2020 11:54 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by mightynova63 »

I'm not a very tech person but i have done some programing before on my 3d printer and botton box's for Iracing. I'm just getting very frustrated I'm trying to build this pendant for my daughters costume and time is running out. are there any other options to get something programed on python or is there a program. i also have a old Gemma on a different project if i really have to i can remove and program that one .

thanks again for the help

User avatar
Franklin97355
 
Posts: 23938
Joined: Mon Apr 21, 2008 2:33 pm

Re: help Gemma Color Touch Pendant Necklace HELP!!!

Post by Franklin97355 »

Did you install the Adafruit SAMD board files and search down the list to find the Gemma M0?
Attachments
2020-10-29_13h35_40.png
2020-10-29_13h35_40.png (21.59 KiB) Viewed 327 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Wearables”