Skip to content

Instantly share code, notes, and snippets.

@joksan
Last active August 29, 2015 13:57
Show Gist options
  • Save joksan/9845714 to your computer and use it in GitHub Desktop.
Save joksan/9845714 to your computer and use it in GitHub Desktop.
Programa de prueba d WiFly
Configuracion del WiFly
=======================
(sin fin de linea)
$$$
(carriage return)
set wlan ssid Taller$Arduino$Day
set ip local 80
save
Comandos utiles
===============
get wlan
factory RESET
#include <SPI.h>
#include "WiFly.h"
WiFlyServer server(80);
void setup() {
WiFly.begin();
Serial.begin(9600);
Serial.print("IP: ");
Serial.println(WiFly.ip());
server.begin();
}
void loop() {
WiFlyClient client = server.available();
if (client) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<HTML>");
client.println("<BODY>");
client.println("<H1> Hola mundo! </H1>");
client.println("</BODY>");
client.println("</HTML>");
client.flush();
client.stop();
}
}
@chepecarlos
Copy link

include <SPI.h>

include "WiFly.h"

Server server(80);

void setup() {
WiFly.begin();

Serial.begin(9600);
WiFly.join("ArduinoDay");
Serial.print("IP: ");
Serial.println(WiFly.ip());
server.begin();
}

void loop() {
Client client = server.available();

if (client) {
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

client.println("");
client.println("");
client.println("

Hola mundo!

");
client.println("");
client.println("");

client.flush();
client.stop();
delay(10);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment