Arnov Sharma
Published © MIT

GOMU GOMU NO MI with XIAO RP2040

Made a Devil Fruit using RGB LEDs, Custom PCBs, and XIAO MCU.

BeginnerFull instructions provided1 hour162

Things used in this project

Hardware components

Seeed Studio XIAO RP2040
Seeed Studio XIAO RP2040
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Seeed Studio Fusion PCB/PCBA
Seeed Studio Fusion PCB/PCBA

Story

Read more

Schematics

sch

Code

code

C/C++
#include <Adafruit_NeoPixel.h>
#define PIN1 D0  //connect D0 
#define PIN2 D1  //connect D1 

#define NUMPIXELS1 15
#define NUMPIXELS2 15

Adafruit_NeoPixel pixels1 = Adafruit_NeoPixel(NUMPIXELS1, PIN1, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel pixels2 = Adafruit_NeoPixel(NUMPIXELS2, PIN2, NEO_GRB + NEO_KHZ800);

int delayval = 10; // timing delay
int redColor = 0;
int greenColor = 0;
int blueColor = 0;


void setup()  {
  pixels1.begin();
  pixels2.begin();

  pixels1.show();
  pixels2.show();

}

void loop() {

  ring1();
  ring2();
  delay(500);

}

void ring1() {
  setColor();

  for(int i=0;i<NUMPIXELS1;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels1.setPixelColor(i, pixels1.Color(redColor, 0, blueColor)); // Moderately bright green color.

    pixels1.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
    
    // Serial.println(i);
    
    if (i == NUMPIXELS1){
      i = 0; // start all over again!
        setColor();
    }

  }
}
  
void ring2() {
  setColor();

  for(int i=0;i<NUMPIXELS2;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels2.setPixelColor(i, pixels2.Color(0, 255, 10)); // Moderately bright green color.

    pixels2.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
    
    // Serial.println(i);
    
    if (i == NUMPIXELS2){
      i = 0; // start all over again!
        setColor();
    }

  }
}


void setColor(){
  redColor = random(0, 20);
  blueColor = random(0, 255);

  
}

Credits

Arnov Sharma
339 projects • 345 followers
Just your average MAKER
Contact

Comments

Please log in or sign up to comment.