Can you write in the sky? Balloon led sign (wifi).

If you assembly small led balloons like a led sign then you can light them up or flash (with MKR1000) and write in the sky "happy birthday",

Intermediate10 hours224
Can you write in the sky? Balloon led sign (wifi).

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Balloon led sign (wifi) - the code

C/C++
Upload the code to mkr1000 and follow the instructions.
#include <SPI.h>
#include <WiFi101.h>

char ssid[] = "CONNX";      
char pass[] = "*****";   
int keyIndex = 0;           

int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  Serial.begin(9600);      
  pinMode(0, OUTPUT);      
  pinMode(1, OUTPUT);      
  pinMode(2, OUTPUT);      
  pinMode(3, OUTPUT);      
  pinMode(4, OUTPUT);      
  pinMode(5, OUTPUT);      
  pinMode(6, OUTPUT);      
  pinMode(7, OUTPUT);      
 if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    while (true);       
  }
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   
    status = WiFi.begin(ssid, pass);
    delay(10000);
  }
  server.begin();                           
  printWifiStatus();                        
}

void loop() {
  WiFiClient client = server.available();   
  if (client) {                             
    Serial.println("new client");          
    String currentLine = "";                
    while (client.connected()) {            
      if (client.available()) {             
        char c = client.read();            
        Serial.write(c);                    
        if (c == '\n') {                   

          if (currentLine.length() == 0) {
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            client.print("Click <a href=\"/H\">here</a> turn the LED on pin 0123456 on<br>");
            client.print("Click <a href=\"/L\">here</a> turn the LED on pin 0123456 off<br>");

            client.println();
            break;
          }
          else {      
            currentLine = "";
          }
        }
        else if (c != '\r') {    
          currentLine += c;      
        }

        if (currentLine.endsWith("GET /H")) {
          digitalWrite(0, HIGH);               
          delay (100);
          digitalWrite(1, HIGH);               
          delay (100);
          digitalWrite(2, HIGH);               
          delay (100);
          digitalWrite(3, HIGH);               
          delay (100);
          digitalWrite(4, HIGH);                    
          delay (100);
          digitalWrite(5, HIGH);               
          delay (100);
          digitalWrite(6, HIGH);               
          delay (100);
          digitalWrite(7, HIGH);               
          delay (1000);
          digitalWrite(0, LOW);                      
          digitalWrite(1, LOW);                       
          digitalWrite(2, LOW);                
          digitalWrite(3, LOW);                      
          digitalWrite(4, LOW);                     
          digitalWrite(5, LOW);                
          digitalWrite(6, LOW);                     
          digitalWrite(7, LOW);                     
          delay (1000);
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(0, LOW);                       
          digitalWrite(1, LOW);                        
          digitalWrite(2, LOW);                
          digitalWrite(3, LOW);                      
          digitalWrite(4, LOW);                        
          digitalWrite(5, LOW);               
          digitalWrite(6, LOW);                     
          digitalWrite(7, LOW);                       
        }
    }
    }
    client.stop();
    Serial.println("client disonnected");
  }
}

void printWifiStatus() {
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
 
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);

Credits

6th Vocational High School, Greece

6th Vocational High School, Greece

1 project • 0 followers
Giannakos Anastasios (Teacher)

Comments