Skip to content

Instantly share code, notes, and snippets.

View recyclerobot's full-sized avatar

Thijs Bernolet recyclerobot

View GitHub Profile
// LED pin definitions
#define LED_RED 11
#define LED_GREEN 9
#define LED_BLUE 7
#define LED_YELLOW 5
#define LED_CORRECT 4
#define LED_WRONG 2
// Button pin definitions
#define BUTTON_RED 12
window.onmessage = function(e){
parent.postMessage(e);
};
// Forward all postMessage calls from the iframes that have data in the form {method:, arguments:} directly to Segment.
window.onmessage = function(e){
var method = e.data.method;
var args = e.data.arguments ? _.values(e.data.arguments) : null;
if (analytics[method]) {
analytics[method].apply(analytics, args);
}
};
//Pin connected to ST_CP of 74HC595
int latchPin = 0;
//Pin connected to SH_CP of 74HC595
int clockPin = 3;
//Pin connected to DS of 74HC595
int dataPin = 2;
// Number of digits attached
Serial.println("GET /a_random_subdirectory_or_file/index.php HTTP/1.1\r\nHost: www.yourserver.com\r\n\r\n");
sendATcommand("AT+CHTTPACT=\"yourserver.com\",80", "+CHTTPACT: REQUEST", 60000);
sendATcommand("AT+CGPSINFO","+CGPSINFO:",1000);
answer = sendATcommand("AT+CGPS=1,2","OK",1000);
sendATcommand("AT+CPIN=1234", "OK", 2000);