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 an arduino timer that will | |
automatically log you out of your computer | |
***beware of unsaved files!!!*** | |
Screen Timer v2 | |
Author: James Shih | |
references | |
https://www.arduino.cc/en/Reference/KeyboardModifiers | |
https://www.arduino.cc/en/Reference/KeyboardPress | |
*/ |
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
/* | |
Screen Timer v1 | |
Author: James Shih | |
references | |
https://www.arduino.cc/en/Reference/KeyboardModifiers | |
https://www.arduino.cc/en/Reference/KeyboardPress | |
*/ | |
#include <Keyboard.h> | |
#include <HID.h> |
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 data = { | |
"computer":{ | |
"tuesday": { | |
"page":438, | |
"general_use":3480, | |
"steam_cs":1560 | |
}, | |
"wednesday":{ | |
"general_use":2948 | |
}, |
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
<?php | |
$host = 'localhost'; | |
$user = 'root'; | |
$pass = 'toor'; | |
@mysql_connect($host,$user,$pass) or die('Connection failed'); | |
@mysql_select_db('cycle'); | |
//echo 'good'; | |
$sql = mysql_query("SELECT * FROM data ORDER BY ID ASC"); | |
$id = 'ID'; | |
$date = 'Date'; |
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
create table data ( | |
ID int(11) AUTO_INCREMENT NOT NULL, | |
Date char(255) NOT NULL, | |
Time char(255) NOT NULL, | |
Status char(3) NOT NULL, | |
Position int(11) NOT NULL, | |
constraint data_PK primary key (ID) | |
); |
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
#ref:http://www.instructables.com/id/Interface-Arduino-to-MySQL-using-Python/?ALLSTEPS | |
import MySQLdb | |
import serial.tools.list_ports | |
db = MySQLdb.connect("localhost","root","toor","cycle") or die ("connection failed") | |
cursor = db.cursor(); | |
ports = list(serial.tools.list_ports.comports()) | |
for p in ports: | |
if "ttyACM" in p[1]: #fpr raspi | |
#if "Arduino" in p[1]: #for mac | |
arduino = serial.Serial('/dev'+p[1],9600,timeout = .1) #for raspi |
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 "FastLED.h" | |
#include "DS3231.h" | |
#define NUM_LEDS 24 | |
#define DATA_PIN 8 | |
#define CLOCK_PIN 9 | |
int pos; | |
int hue; | |
unsigned long pTime; | |
unsigned long dTime; | |
int potVal; |
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 "ofMain.h" | |
#include "ofApp.h" | |
//======================================================================== | |
int main( ){ | |
ofSetupOpenGL(1280,800,OF_WINDOW); // <-------- setup the GL context | |
// this kicks off the running of my app | |
// can be OF_WINDOW or OF_FULLSCREEN |
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 "ofApp.h" | |
ofNode base; | |
ofNode secondNode; | |
ofNode thirdNode; | |
ofPolyline line; | |
ofEasyCam cam; | |
ofSerial serial; | |
float a; |
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 "FastLED.h" | |
#define NUM_LEDS 15 | |
#define DATA_PIN 8 | |
#define CLOCK_PIN 9 | |
#define BUTTON_PIN 2 | |
CRGB leds[NUM_LEDS]; | |
int val; | |
int counter; | |
int caseState; | |
unsigned long pTime; |