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
var https = require('https'); | |
var kitchenLightApplianceId = "A146-3456-b31d-7ec4c146c5ea"; | |
var bedroomLightApplianceId = "A146-3456-b31d-7ec4c146c5eb"; | |
var particleServer = "api.particle.io"; | |
var particlePath = "/v1/devices/"; | |
/** | |
* Main entry point. | |
* Incoming events from Alexa Lighting APIs are processed via this method. |
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
/* | |
* | |
* | |
*/ | |
PImage sourceImage; | |
PImage destinationImage; | |
int sourceDivX = 4; | |
int sourceDivY = 3; |
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 Particle IDE. | |
#include "SparkJson/SparkJson.h" | |
TCPClient client; | |
#define DOMAIN "api.openweathermap.org" | |
char* c=""; | |
char d; | |
int pastTime = 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
void setup() { | |
// put your setup code here, to run once: | |
pinMode(0, OUTPUT); // PWMA | |
pinMode(1, OUTPUT); // AI1 | |
pinMode(2, OUTPUT); // AI2 | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
digitalWrite(1, LOW); // DIR |
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 Particle IDE. | |
// Add the library to your sketch via the IDE, too. | |
#include <neopixel.h> | |
#define PIXEL_PIN D0 | |
#define PIXEL_COUNT 1 | |
#define PIXEL_TYPE WS2812B | |
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE); |
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 Particle IDE. | |
#include <neopixel.h> | |
#define PIXEL_PIN D0 | |
#define PIXEL_COUNT 1 | |
#define PIXEL_TYPE WS2812B | |
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE); | |
int lightVal = 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
//programing 2 range sensors and having info published on computer// | |
// This #include statement was automatically added by the Particle IDE.// | |
#include <New_Ping.h> | |
//Define constrants// | |
// D0 pin will be used for the LEDs eventualy// | |
#define TRIGGER_PIN_1 D1 | |
#define ECHO_PIN_1 D1 | |
#define TRIGGER_PIN_2 D2 |
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
/* | |
Smoothing | |
Reads repeatedly from an analog input, calculating a running average and | |
printing it to the computer. Keeps ten readings in an array and continually | |
averages them. | |
The circuit: | |
- analog sensor (potentiometer will do) attached to analog input 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
#define STEP 0 | |
#define DIR 1 | |
#define LED 7 | |
void setup() { | |
pinMode(STEP, OUTPUT); | |
pinMode(DIR, OUTPUT); | |
pinMode(LED, OUTPUT); | |
digitalWrite(DIR, LOW); | |
} |