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
int ddl = 0; // Ding dong last millis() | |
int btnpin = D0; // "Button" pin | |
const int ddd = 15000; // Time until button can be activated again | |
void setup() { | |
pinMode(btnpin, INPUT_PULLUP); | |
RGB.control(true); | |
} |
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 is a simple "sketch" that calls a web page when a button is pressed. It is a proof-of-concept | |
* for my boss and hastily written in about 2 hours. The remote URL is a PHP script that handles | |
* making the API calls to a remote SMS-messaging service. | |
* | |
* I'm sure it could make use of interrupts somehow, but I'm not sure how off the top of my head. | |
* | |
* It uses the onboard RGB LED as status display: | |
* - Red = Waiting to be pressed | |
* - Green = Making HTTP request |
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 "DHT22.h" | |
DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) { | |
_pin = pin; | |
_type = type; | |
_count = count; | |
firstreading = true; | |
_next_read_millis = 0; | |
_next_read_step = 1; | |
} |
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 "DHT.h" | |
DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) { | |
_pin = pin; | |
_type = type; | |
_count = count; | |
firstreading = true; | |
} | |
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
char srvIP[] = "198.199.86.22"; | |
char srvHost[] = "spark.wgb.me"; | |
int srvPort = 80; | |
char srvPath[] = "/logger/?l=uptime-test"; | |
void setup() { | |
delay(5000); | |
pinMode(D7, OUTPUT); |
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
// D0 = Angle Down | |
// D1 = Angle Up | |
// D2 = Left | |
// D3 = Right | |
int pinLeft = D2; | |
int pinRight = D3; | |
int pinDown = D0; | |
int pinUp = D1; |
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
#!/usr/bin/python | |
import pygame, httplib, io | |
from pygame.locals import * | |
from PIL import Image, ImageFont, ImageDraw | |
from time import time, sleep, strftime, localtime | |
# Screen setup | |
print "Press ctrl+c" | |
display = pygame.display |
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
#!/bin/bash | |
for d in $(find www-enabled/ -mindepth 1 -maxdepth 1 -type l); do | |
bn=`basename $d` | |
aliases_arr=($bn) | |
aliases_i=1 | |
# Check if the container is already running | |
is_running=`docker ps -f status=running | grep "$bn" | wc -l` |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="http://benpickles.github.io/peity/jquery.peity.js"></script> | |
<script type="text/javascript"> |
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 monitors a Discourse forum for postings by a particular user. | |
* I stopped just shy of figuring out how to publish an event to a | |
* Particle device PubSub stream. | |
**/ | |
var https = require('https'), | |
cp = require('child_process'), | |
xmlParseString = require('xml2js').parseString; |
OlderNewer