You must enable Javascript on your browser for the site to work optimally and display sections completely.

Adafruit NeoPixel FeatherWing with Feather HAZZAH ESP8266 WiFi

By default, the NeoPixel FeatherWing has a default jumper set that isn't compatible with the Adafruit HAZZAH Feater with ESP8226 WiFi.  You must use a knife to break or cut the jumper and solder a new one. You cannot have two control jumpers set.

The default jumper was for the ESP8266 HAZZAH is set to pin #16.  I changed mine to pin #15 as shown below.

Using code that I found here by Richard Hayler, we can test our fix.  The following code checks for any open WiFi networks within range.  If it finds any, it will show red. If it does not find any, it will show green.

#include "ESP8266WiFi.h"
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, 15, NEO_GRB + NEO_KHZ800);
int OPEN = 0;
void allOn(char* col);
void setup() {
  pixels.begin();
  Serial.begin(115200);
  // Set WiFi to station mode and disconnect from an AP if it was previously connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
  Serial.println("Setup done");
}
void allOn(char* col) {
    //Pulsing
        if (col == "red"){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
            for (int p=0;p<200;p++){
                for(int i=0;i<32;i++){
                 // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
                    pixels.setPixelColor(i, pixels.Color(p,0,0)); // Moderately bright red color.
                    pixels.show();
                }
            delay(1);
            }
            for (int p=200;p>0;p--){
                for(int i=0;i<32;i++){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
                    pixels.setPixelColor(i, pixels.Color(p,0,0)); // Moderately bright red color.
                    pixels.show();
                }
            delay(1);
            }
        } else {
           for (int p=0;p<200;p++){
               for(int i=0;i<32;i++){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
                   pixels.setPixelColor(i, pixels.Color(0,p,0)); // Moderately bright green color.
                   pixels.show();
               }
           delay(1);
           }
           for (int p=200;p>0;p--){
               for(int i=0;i<32;i++){
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
                   pixels.setPixelColor(i, pixels.Color(0,p,0)); // Moderately bright green color.
                   pixels.show();
               }
          delay(1);
          }
       }
    //}
}
void loop() {
  Serial.println("Starting Scan");
  // WiFi.scanNetworks will return the number of networks found
  int n = WiFi.scanNetworks();
  Serial.println("Scan complete");
  if (n == 0)
    Serial.println("No networks found");
  else
  {
    Serial.print(n);
    Serial.println(" networks found:");
    for (int i = 0; i < n; ++i)
    {
      // Print SSID and RSSI for each network found
      Serial.print(i + 1);
      Serial.print(": ");
      Serial.print(WiFi.SSID(i));
      Serial.print(" (");
      Serial.print(WiFi.RSSI(i));
      Serial.print(")");
      byte enc = WiFi.encryptionType(i);
      Serial.print(" Encryption: ");
      Serial.println(enc,HEX);
      // No encryption - open network
      if (enc == 7){
        OPEN++;
      }
      delay(10);
    }
  }
  if (OPEN  > 0){
    Serial.println("Alert");
    allOn("red");
  } else {
    Serial.println("All good");
    allOn("green");
  }
  pixels.show();
  Serial.println("");
  OPEN = 0;
}

Additional Resources

Getting started with Adafruit Feather Huzzah and Neopixel FeatherWing by Richard Hayler
The Magic of NeoPixels; NeoPixel Uber Guide by Adafruit
Easy Alexa (Echo) Control of your ESP8266 Huzzah
- by Adafruit

comments powered by Disqus

Arduino esp8266 featherwing neopixel feather huzzah adafruit echo alexa wemo

Views: 1836