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
import ustruct | |
import time | |
_REGISTER_MASK = const(0x03) | |
_REGISTER_CONVERT = const(0x00) | |
_REGISTER_CONFIG = const(0x01) | |
_REGISTER_LOWTHRESH = const(0x02) | |
_REGISTER_HITHRESH = const(0x03) |
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
curl -sSL https://get.docker.com | sh | |
sudo systemctl enable docker | |
sudo systemctl start docker | |
sudo usermod -aG docker pi | |
# Log out and back in to use docker commands |
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 s = "WTF?" | |
void setup() { | |
} | |
void loop() { | |
} |
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 x = NULL; | |
void setup() {} | |
void loop() {} |
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 "google-maps-device-locator.h" | |
GoogleMapsDeviceLocator locator; | |
void setup() { | |
Serial.begin(9600); | |
locator.withLocatePeriodic(120); | |
} | |
void loop() { |
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
unsigned long uptime; | |
time_t t; | |
void setup() { | |
Serial.begin(); | |
delay(5000); | |
Serial.println("=============================="); | |
Serial.println(" Particle Time Demo"); | |
Serial.println("=============================="); | |
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
void setup() { | |
delay(5000); // Give yourself 5 seconds to launch particle serial monitor | |
Serial.begin(); | |
USBSerial1.begin(); | |
Serial.println("Serial port configured!"); | |
USBSerial1.println("USBSerial1 configured too!"); | |
pinMode(D7, OUTPUT); | |
} | |
void loop() { |
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
var config = require("./config.js"); | |
var socket = require("socket.io-client")(config.server_url); | |
var gpio = require("rpi-gpio"); | |
var sensorLib = require('node-dht-sensor'); | |
var data=0; | |
process.on("SIGINT", function(){ | |
gpio.write(config.led, 1, function(){ | |
gpio.destroy(function(){ |
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
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
int val = analogRead(A0); | |
float voltage = val * 3.3 / 4096; // Convert analog reading to voltage value | |
float tempC = (voltage - 0.5) * 100; | |
float tempF = (tempC * 9.0 / 5.0) + 32.0; | |
Serial.printlnf("Temp F: %3.1f Temp C: %3.1f", tempF, tempC); |
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 <time.h> | |
#define TARGET_MONTH 12 | |
#define TARGET_DAY 25 | |
#define TARGET_YEAR 2016 | |
#define CLEAR_COMMAND 0x76 | |
#define CURSOR_COMMAND 0x79 | |
struct tm target = {0}; |