Portable WIFI RGB 3D Printed Big Letters

Here it is this weeks project. Enjoy!!

Update:

In case anyone wants to try and do something like this, I did use an ESP8266, the more common one, like this from SparkFun.

I did use a modification of the web server example mixed with one of the Neopixel examples:

Here it is:
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

IPAddress ip(192,168,1,200); //Node static IP //MODIFY THIS TO SUIT YOUR NETWORK
IPAddress gateway(192,168,1,1);////MODIFY THIS TO SUIT YOUR NETWORK
IPAddress subnet(255,255,255,0);//MODIFY THIS TO SUIT YOUR NETWORK
#define NUMPIXELS 16
#define PIN 2

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int inter=0;
int modo=0;

const char* ssid = “……………”;//MODIFY THIS TO SUIT YOUR NETWORK
const char* password = “………………”;//MODIFY THIS TO SUIT YOUR NETWORK

MDNSResponder mdns;

ESP8266WebServer server(80);

void handleRoot() {

server.send(200, “text/plain”, “hello from esp8266!”);

}

void R()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(255,0,0));
pixels.show();
}
}
void G()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(0,255,0));
pixels.show();
}
}
void B()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(0,0,255));
pixels.show();
}
}

void W()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(255,255,255));
pixels.show();
}
}

void FUC()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(255,0,255));
pixels.show();
}
}

void A()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(0,255,255));
pixels.show();
}
}

void BLACK()
{
modo = 0;
for(int i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(i, pixels.Color(0,0,0));
pixels.show();
}
}

void PARPA()
{
modo = 1;
}

void pparpa()
{
for(int i=0;i<8;i++)
{
pixels.setPixelColor(i, pixels.Color(255,255,255));

}

if (inter==0)
{
inter=1;
for(int i=6;i<8;i++)
{
pixels.setPixelColor(i, pixels.Color(255,255,255));

}

}
else if (inter==1)
{
inter=0;
for(int i=6;i<8;i++)
{
pixels.setPixelColor(i, pixels.Color(0,0,0));

}
}
pixels.show();
delay(500);
}

void handleNotFound(){

String message = “File Not Found\n\n”;
message += “URI: “;
message += server.uri();
message += “\nMethod: “;
message += (server.method() == HTTP_GET)?”GET”:”POST”;
message += “\nArguments: “;
message += server.args();
message += “\n”;
for (uint8_t i=0; i<server.args(); i++){
message += ” ” + server.argName(i) + “: ” + server.arg(i) + “\n”;
}
server.send(404, “text/plain”, message);

}

void setup(void){
Serial.begin(115200);
Serial.println(“Starting…”);
WiFi.begin(ssid, password);
WiFi.config(ip, gateway, subnet);
Serial.println(“”);
pixels.begin();
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}

Serial.println(“”);
Serial.print(“Connected to “);
Serial.println(ssid);
Serial.print(“IP address: “);
Serial.println(WiFi.localIP());

if (mdns.begin(“esp8266”, WiFi.localIP())) {
Serial.println(“MDNS responder started”);
}

server.on(“/”, handleRoot);
server.on(“/RED”, R);
server.on(“/GREEN”, G);
server.on(“/BLUE”, B);
server.on(“/PARPA”, PARPA);
server.on(“/WHITE”, W);
server.on(“/AQUA”, A);
server.on(“/FUCHSIA”, FUC);
server.on(“/BLACK”, BLACK);
server.on(“/inline”, [](){
server.send(200, “text/plain”, “this works as well”);

});

server.onNotFound(handleNotFound);

server.begin();
Serial.println(“HTTP server started”);
}

void loop(void){

server.handleClient();
if (modo==1)
{
pparpa();
}

}

 

By | 2016-10-15T16:35:05+00:00 October 10th, 2016|Industrial Design, Projects, Prototyping, Uncategorized|0 Comments

About the Author: