Setup Adafruit Feather M0 for Arduino IDE

Before we start disassembling or building the circuit, it's a good idea to get code uploaded to the micro-controller first. If you don't write / understand code, don't to worry! You don't need to be a programmer to be able to upload prewritten code :-) 

We'll walk you through the whole process. 

First, visit the Adafruit M0 tutorial page by clicking the button below. Follow the instructions to download & setup the Arduino IDE and install drivers.

Make sure you are able to get sketches compiled and uploaded, especially the blink example in the tutorial. Once you are comfortable with using the Adafruit Feather, you can continue!

Install Adafruit NeoPixel Library

Next, we need to add support for NeoPixels.

Visit the Adafruit NeoPixel tutorial to install the NeoPixel library!

Uploading Code to Board

Now that we have the Adafruit boards & NeoPixel library installed, we can get our code ready to upload onto the board. Select all of the code listed below in the black box and copy it to your clip board. Then, in Arduino IDE, paste it in the sketch window (making sure to overwrite anything currently there). Next, goto the Tools menu > Board and select Adafruit Feather M0 (Native USB Port) Now you can click on the "check mark" icon to verify the code. If it's all good, we can continue to upload the code to the board.

Connect USB Data Cable to Feather M0

Be sure to use a micro USB cable that can transfer data - A USB cable that ONLY charges devices will simply not work. Plug it into the microUSB port on the Adafruit Feather M0 board and the USB port on your computer (try to avoid connecting to a USB hub). As soon as you plug it in, you'll see a red LED blink on the Adaruit Feather M0 - This let's you know the board is ready to except code. While the LED is blinking, click on the Upload button (It's a right arrow icon, next to the check mark). The Arduino IDE will notify you if the upload is successful and completed.

// Original Code by Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

#include <Adafruit_NeoPixel.h>

// Strip goes to pin 6, jewel goes to pin 5 on Adafruit Feather
#define STRIPPIN            6
#define JEWELPIN            5

// Setting up the two neopixel objects

Adafruit_NeoPixel strip = Adafruit_NeoPixel(144, STRIPPIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel jewel = Adafruit_NeoPixel(8, JEWELPIN, NEO_GRB + NEO_KHZ800);

int delayval = 10; // super quick delay, increase this value to make the wipe go slower

void setup() {
  strip.setBrightness(80); // increase value to increase brightness, 255 is max
  jewel.setBrightness(80); // increase value to increase brightness, 255 is max
  strip.begin();
  jewel.begin();
}

void loop() {

  for(int i=0;i<8;i++){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    jewel.setPixelColor(i, jewel.Color(255, 60, 0)); // Orange color.
    jewel.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }

  for(int i=0;i<144;i++){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    strip.setPixelColor(i, strip.Color(0,100, 255)); // blue color.
    strip.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
}
This guide was first published on Aug 02, 2017. It was last updated on Sep 11, 2018. This page (Code) was last updated on Aug 02, 2017.