Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created August 7, 2012 20:14
Show Gist options
  • Save jonmarkgo/3288968 to your computer and use it in GitHub Desktop.
Save jonmarkgo/3288968 to your computer and use it in GitHub Desktop.
poweroutlet1
#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;
SoftwareSerial wifiSerial(2,3); //we will use these pins for debug output
int poweroutlet = 12; //pinout for the powerswitch
int led = 13; //status indicator led
WiFly wifly;
void setup() {
//initialize our digital pinouts
pinMode(poweroutlet, OUTPUT);
pinMode(led, OUTPUT);
//turn off the poweroutlet and led starting out
digitalWrite(poweroutlet, LOW);
digitalWrite(led, LOW);
wifiSerial.begin(57600);
Serial.begin(9600);
if (!wifly.begin(&Serial, &wifiSerial)) { //start up the serial connection to our wifi, tell the WiFlyHQ lib to use our softwareserial for debug
wifiSerial.println(F("Failed to start wifly"));
wifly.terminal(); //if the wifly fails to start, give us access to a direct serial terminal to the RN-XV
}
//paste next block of code here
}
//paste loop function here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment