This file contains 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
void setup() { | |
initWifi(); | |
} | |
void loop() { | |
} | |
void initWifi() { |
This file contains 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 "application.h" | |
#include "spark_disable_wlan.h" | |
#include "spark_disable_cloud.h" | |
int state = 0; | |
int awake = 0; | |
unsigned int lastWakeup = 0; | |
//wakeup once a minute | |
unsigned int wakeupDelay = 60 * 1000; |
This file contains 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
/** | |
* Created by middleca on 7/17/14. | |
*/ | |
var when = require('when'); | |
var settings = { | |
ip: "192.168.1.49", | |
port: 80, | |
start_size: 0, | |
end_size: 1024 |
This file contains 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
/* | |
* Bitcoin Price Index JSON Parsing TCP Client Example | |
* BDub @ Technobly.com 6/27/2014 | |
* LICENSE: MIT (C) 2014 BDub | |
* | |
*/ | |
#pragma SPARK_NO_PREPROCESSOR | |
#include "application.h" |
This file contains 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
// | |
// To start out we're going to define some things to allow for cleaner code below; let's start with our twitter auth info: | |
// | |
#define TWITTER_OAUTH "ENTER YOUR ACCESS TOKEN HERE" | |
#define LIB_DOMAIN "arduino-tweet.appspot.com" | |
// | |
// lets be good Twitter citizens and limit the number of times our pumpkins tweets when it's calm. Below you can see it's set to | |
// send a calm tweet every 45 minutes at the absolute most. It will send an "alarm" tweet only every minute | |
// |
This file contains 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
// This #include statement was automatically added by the Spark IDE. | |
#include "neopixel/neopixel.h" | |
// 'Firewalker' LED sneakers sketch for Adafruit NeoPixels by Phillip Burgess | |
const uint8_t gamma[] = { // Gamma correction table for LED brightness | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, | |
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, | |
2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, |
This file contains 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
#define TWITTER_OAUTH "___insert_your_oauth_string_here___" | |
#define LIB_DOMAIN "arduino-tweet.appspot.com" | |
#pragma SPARK_NO_PREPROCESSOR | |
// In case we're compiling locally: | |
#include "application.h" | |
void next_alarm_tweet(); | |
void next_calm_tweet() ; |
This file contains 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
// This #include statement was automatically added by the Spark IDE. | |
#include "neopixel/neopixel.h" | |
// IMPORTANT: Set pixel COUNT, PIN and TYPE | |
#define PIXEL_PIN D2 | |
#define PIXEL_COUNT 300 | |
#define PIXEL_TYPE WS2812B | |
int reds[PIXEL_COUNT]; | |
int greens[PIXEL_COUNT]; |
This file contains 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 "application.h" | |
class TempSensor { | |
public: | |
char *id ; | |
uint8_t rom[8]; | |
float value ; | |
int updated = 0; | |
}; |
This file contains 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
unsigned int last_heartbeat = 0; | |
#define HEARTBEAT_PERIOD_SECONDS 60 | |
#define MAX_MISSED_HEARTBEATS 3 | |
void setup() { | |
Serial.begin(115200); | |
Spark.subscribe("heartbeat", heartbeat_handler); | |
//Spark.subscribe("heartbeat", heartbeat_handler, MY_DEVICES); | |
last_heartbeat = millis(); | |
} |
OlderNewer