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
| // libraries for i2c and the specific display | |
| #include <Wire.h> | |
| #include "rgb_lcd.h" | |
| rgb_lcd lcd; | |
| void setup() { | |
| // make sure the random is random | |
| randomSeed(analogRead(0)); |
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() { | |
| // put your setup code here, to run once: | |
| pinMode(A0,OUTPUT); | |
| pinMode(A1,OUTPUT); | |
| randomSeed(42); | |
| } | |
| void loop() { | |
| // put your main code here, to run repeatedly: | |
| int bright; |
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
| from time import sleep | |
| import machine | |
| from machine import Pin | |
| redled = machine.Pin(0, machine.Pin.OUT) | |
| blueled = machine.Pin(2, machine.Pin.OUT) | |
| redled.value(0) | |
| blueled.value(1) |
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
| <?php | |
| /* | |
| PHP SCRIPT TO BACK UP FLICKR PHOTOSETS | |
| Arguments: | |
| APIKEY, SECRET, FLICKER_USER | |
| */ |
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 phant | |
| import time | |
| log = phant.writer_factory( | |
| 'http://data.sparkfun.com/input/qwerty10987?private_key=abcdefgh12345', | |
| key=str, | |
| value=int | |
| ) | |
| i = 0 |
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
| #!/bin/bash | |
| # Set the date variable to the current date and time | |
| DATE=$(date +"%Y-%m-%d_%H%M") | |
| # Take the picture and save with the date as filename | |
| raspistill --rotation 270 -w 1024 -h 768 -o /home/pi/pics/$DATE.jpg | |
| # Add the date caption | |
| convert /home/pi/pics/$DATE.jpg -pointsize 32 -fill red -annotate +700+700 $DATE /home/pi/pics/$DATE.jpg |
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 subprocess | |
| import requests | |
| # load API key from file | |
| inFile = open('/home/pi/mailgun-api.txt', 'r') | |
| api_key = inFile.readline().rstrip() | |
| inFile.close() | |
| # get host and IP | |
| this_host = subprocess.check_output("hostname", shell=True).rstrip() |
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
| // wifi library | |
| #include <WiFi.h> | |
| // WiFi network name and password: | |
| const char * networkName = "YOUR_WIFI_HERE"; | |
| const char * networkPswd = "PASSWORD_HERE"; | |
| // The domain to request from: | |
| const char * hostDomain = "chrisg.org"; | |
| const int hostPort = 80; |
NewerOlder