Axiometa
Two Pad (Inline)
Two Pad (Inline)
SKU:AX22-0042
Out of stock
Regular price
$2.49
Regular price
Sale price
$2.49
Unit price
per
Taxes included.
Shipping calculated at checkout.
Couldn't load pickup availability

Technical Details
Pinout
Arduino Example Snippet
#include <Adafruit_NeoPixel.h>
#define LED_PIN 18
#define LED_COUNT 1
#define BTN1 40
#define BTN2 38
Adafruit_NeoPixel led(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
int colorIndex = 0;
uint32_t colors[] = {
led.Color(255, 0, 0), // red
led.Color(0, 255, 0), // green
led.Color(0, 0, 255), // blue
led.Color(255, 255, 0), // yellow
led.Color(255, 0, 255), // magenta
led.Color(0, 255, 255), // cyan
led.Color(255, 255, 255) // white
};
void setup() {
pinMode(BTN1, INPUT_PULLUP);
pinMode(BTN2, INPUT_PULLUP);
led.begin();
led.setBrightness(100);
led.show();
}
void loop() {
if (!digitalRead(BTN1)) { // button 1 pressed
colorIndex = (colorIndex + 1) % 7;
led.setPixelColor(0, colors[colorIndex]);
led.show();
delay(250); // debounce
}
if (!digitalRead(BTN2)) { // button 2 pressed
colorIndex = (colorIndex - 1 + 7) % 7;
led.setPixelColor(0, colors[colorIndex]);
led.show();
delay(250); // debounce
}
}