Skip to content

Instantly share code, notes, and snippets.

<?php //mysql_connect.php
DEFINE ('DB_USER', 'userName'); //config
DEFINE ('DB_PASSWORD', 'Password'); //config
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'DB_Name'); //config
//Make the connection
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('could not connect to mysql:'.mysql_error());
@ameyer
ameyer / Arduino.pde
Created June 26, 2009 06:29
Arduino code to do light dimmer stuffs
#define lampPin 6
#define adjustPin 0
#define touchPin 1
//LEDs
int g1 = 8;
int g2 = 9;
int w1 = 10;
int w2 = 11;
int r1 = 12;
message RequestEnvelop {
required int32 unknown1 = 1;
optional int64 rpc_id = 3;
repeated Requests requests = 4;
optional Unknown6 unknown6 = 6;
optional double latitude = 7;
optional double longitude = 8;
optional double altitude = 9;
optional AuthInfo auth = 10;
optional AuthTicket auth_ticket = 11;
#define DIR_PIN 2
#define STEP_PIN 3
void setup() {
pinMode(DIR_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
}
void loop(){
rotate(1600, .25);