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
String.prototype.trunc = String.prototype.trunc || function(n){ | |
return (this.length > n) ? this.substr(0, n-1) + '…' : this; | |
}; | |
console.log("".trunc(50)); |
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
export default (genFunc) => { | |
let next = null; | |
do { | |
next = genFunc.next(); | |
} while (!next.done); | |
return next.value; | |
}; |
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 <WEMOS_SHT3X.h> | |
SHT3X sht30(0x45); | |
// Wifi and ThingSpeak settings | |
#include <ESP8266WiFi.h> | |
const char* ssid = ""; | |
const char* password = ""; | |
const char* server = "api.thingspeak.com"; |
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 <FastLED.h> | |
#define LED_PIN 5 | |
#define NUM_LEDS 30 | |
#define ANIMATION_FRAME_TIME 80 | |
CRGB leds[NUM_LEDS]; | |
int counter = 0; | |
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
#define NUM_LEDS 6 | |
#define OFF 0 | |
#define ON 1 | |
int PINS[] = {5, 4, 0, 2, 14, 12}; | |
void setup() { | |
Serial.begin(115200); | |
for(int i = 0; i < NUM_LEDS; i++) { |
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 "Wire.h" | |
#include <ESP8266HTTPClient.h> | |
#include <ESP8266WiFi.h> | |
const int MPU_ADDR = 0x68; // I2C address of the MPU-6050 | |
const int MOVING_DELTA_THRESHOLD = 1000; | |
const int ALARM_PENALTY_MILLIS = 60000; | |
const char* WIFI_SSID = "Rumblebuff"; // The SSID (name) of the Wi-Fi network you want to connect to | |
const char* WIFI_PASSWORD = "7696298557852265"; // The password of the Wi-Fi network |
OlderNewer