Mini 8-Way Rotary Selector Switch neopixel colors

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Maker4091
 
Posts: 4
Joined: Tue Jun 15, 2021 8:55 pm

Mini 8-Way Rotary Selector Switch neopixel colors

Post by Maker4091 »

Hello,

I havent done much with the coding aspect of this at all.

What I am trying to do it use a Trinket M0 (or other board IE Gemma) to add some color choices to a wearable.

I would like to set it so that I can put a few different choice colors or patterns associated with the Neopixels so I wont need to use an external program source, or just get random colors/ loops going through the neopixels.

Any advice would be appreciated

User avatar
XRAD
 
Posts: 754
Joined: Sat Nov 19, 2016 3:28 pm

Re: Mini 8-Way Rotary Selector Switch neopixel colors

Post by XRAD »

one option: use the on board touch sensor to rotate through choices. Tested and works.
or just a simple button press counter....or a motion sensor....etc...some of the other adafruit boards provide more on board options

Code: Select all

// touch - Capacitive touch demo using FreeTouch. Trinket M0 version. uses trinket pin 1

#include "Adafruit_FreeTouch.h"

Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(A0, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);

void setup() 
{
  // Initialize A0 as a touch sensor
  if (! qt_1.begin())  
    Serial.println("Failed to begin qt on pin A0");
}

void loop() 
{
  int counter, result = 0; 
  counter = millis();
  result = qt_1.measure(); 
  Serial.print("QT 1: "); Serial.print(result);
  Serial.print(" (");  Serial.print(millis() - counter); Serial.println(" ms)");
  Serial.println("\n*************************************"); 
  delay(200);
}

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

Return to “Trinket ATTiny, Trinket M0”