This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFlyHQ.h> | |
#include <SoftwareSerial.h> | |
#include <PusherClient.h> | |
const char mySSID[] = "my$ssid"; //use $ to represent spaces in your ssid or passphrase | |
const char myPassword[] = "my$pass$phrase"; | |
const char pusherKey[] = "abc123"; | |
PusherClient client; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paste powerSwitch function here | |
void powerSwitch(String data) { | |
String cmd = client.parseMessageMember("command", data); | |
wifiSerial.print("Command: "); | |
wifiSerial.println(cmd); | |
if (cmd == "on") { | |
digitalWrite(poweroutlet,HIGH); | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paste loop function here | |
void loop() { | |
if (client.connected()) { | |
digitalWrite(led,HIGH); | |
client.monitor(); | |
} | |
} | |
//paste powerSwitch function here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paste next block of code here | |
if (!wifly.isAssociated()) { //check to see if we are already associated with the network before connecting | |
wifiSerial.println(F("Joining network")); | |
if (wifly.join(mySSID, myPassword, true)) { //using the true flag at the end of wifly.join indicates that we are using WPA | |
wifly.save(); | |
wifiSerial.println(F("Joined wifi network")); | |
} | |
else { | |
wifiSerial.println(F("Failed to join wifi network")); | |
wifly.terminal(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFlyHQ.h> | |
#include <SoftwareSerial.h> | |
#include <PusherClient.h> | |
const char mySSID[] = "my$ssid"; //use $ to represent spaces in your ssid or passphrase | |
const char myPassword[] = "my$pass$phrase"; | |
const char pusherKey[] = "abc123"; | |
PusherClient client; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$("#searchbutton").click(function () { | |
// Build OData query | |
var movieName = $("#search").val(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <EEPROM.h> | |
#include "EEPROMAnything.h" | |
struct User | |
{ | |
char * phonenumber; | |
} user; | |
User authUsers[3]; | |
User defUsers[3]; | |
void setup() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFlyHQ.h> | |
#include <SD.h> | |
#include <PusherClient.h> | |
PusherClient client; | |
WiFly wifly; | |
File permFile; | |
void setup() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* WiFlyHQ Example WebSocketClient.ino | |
* | |
* This sketch implements a simple websocket client that connects to a | |
* websocket echo server, sends a message, and receives the response. | |
* Accepts a line of text via the wifiSerial monitor, sends it to the websocket | |
* echo server, and receives the echo response. | |
* See http://www.websocket.org for more information. | |
* | |
* This sketch is released to the public domain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-type: text/xml'); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
$message = strip_tags($_REQUEST['Body']); | |
$response = "Welcome to the Cost of Freedom. Please text your state abbreviation to get Voter ID requirements and info."; | |
//our spreadsheet's key | |
$key = "0Aoz1Ir-h-0g5dG00N1lDVG1COTFHellrc2o2bDhoeXc"; | |
//the public url |