Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created October 4, 2012 18:35
Show Gist options
  • Save jonmarkgo/3835513 to your computer and use it in GitHub Desktop.
Save jonmarkgo/3835513 to your computer and use it in GitHub Desktop.
#include <WiFlyHQ.h>
#include <ColorLCDShield.h>
const char mySSID[] = "abc"; //use $ to represent spaces in your ssid or passphrase
const char myPassword[] = "a1234";
WiFly wifly;
LCDShield lcd;
void setup() {
lcd.init(PHILLIPS); // Initializes lcd, using an EPSON driver
lcd.contrast(40); // 40's usually a good contrast value
lcd.clear(WHITE); // clear the screen
//lcd.setStr("Just say no", 2, 20, SLATE, WHITE);
//lcd.setStr("to addition", 110, 20, SLATE, WHITE);
//lcd.clear(WHITE); // clear the screen
lcd.setCircle(66, 66, 45, RED); // Circle in the mid, 55 radius
lcd.setCircle(66, 66, 44, RED); // Circle in the mid, 54 radius
lcd.setRect(55, 34, 77, 98, 1, BLACK);
lcd.setRect(34, 55, 98, 77, 1, BLACK);
lcd.setLine(34, 34, 98, 98, RED);
lcd.setLine(33, 34, 97, 98, RED);
lcd.setLine(35, 34, 99, 98, RED);
Serial.begin(9600);
wifly.begin(&Serial, NULL);
if (!wifly.isAssociated()) { //check to see if we are already associated with the network before connecting
if (wifly.join(mySSID, myPassword, true)) { //using the true flag at the end of wifly.join indicates that we are using WPA
wifly.save();
}
}
wifly.setIpProtocol(WIFLY_PROTOCOL_TCP);
wifly.open("127.0.0.1",1337);
wifly.println("Hello, world!!!");
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment