Skip to content

Instantly share code, notes, and snippets.

View HFreni's full-sized avatar

Harrison Freni HFreni

View GitHub Profile
import SimpleHTTPServer
import SocketServer
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
// Put in Main File
#include "menu.h"
#include "auton.h"
void pre_auton()
{
clearLCDLine(0);
clearLCDLine(1);
bLCDBacklight = true;
calibrateGyro();
// Update inteval (in mS) for the flywheel control loop
#define FW_LOOP_SPEED 25
// Maximum power we want to send to the flywheel motors
#define FW_MAX_POWER 127
// encoder counts per revolution depending on motor
#define MOTOR_TPR_269 240.448
#define MOTOR_TPR_393R 261.333
#define MOTOR_TPR_393S 392
@HFreni
HFreni / Code.c
Last active November 3, 2015 02:43
/* The P is a really small value, so lets say the high speed is 80 and the low speed is 20, if you are 1000 rpm
* away it might go at 110 but as you get close it will decrease to 80, and if you are 1000 rpm above it would
* at 0 and as you get slower and approach the target speed you will get closer to 20 just going 127 and 0 will
* cause you to overshoot and drop over and over again, using P ontop of it will help reduce the amount of drop
* and overshoot while still having the fast recovery time of bang bang.
*
* Formula: highspeed + difference in rpm * P constant, lowspeed + differnece in rpm * P constant
*/
float kP = 0.0;
name = "Harrison"
age = 16
hobbies = ["Robotics", "Programming", "Gaming", "Skiing"]
print(name + " Is " + str(age) + " Years Old")
for hobby in hobbies:
print(name + " likes: " + hobby)
# Print a message to welcome the buyer
print("Welcome to Harrison's Movie Ticket Software!")
#Inputs To Check for how many people
k = input("Please enter the number of children: ")
a = input("Please enter the number of adults: ")
s = input("Please enter the number of seniors: ")
#Price Variables
kP = 10
print("Welcome to Harrison's Movie Ticket Software!\nWARNING: You May Only Have 4 Guests.")
p1a = input("Please enter the age of your first guest: ")
p2a = input("Please enter the age of your first guest: ")
p3a = input("Please enter the age of your first guest: ")
p4a = input("Please enter the age of your first guest: ")
guests = [p1a, p2a, p3a, p4a]
def f(x):
return x**2
print(str(f(4)))
@HFreni
HFreni / Level1.m
Last active March 7, 2016 22:57
Try Objective-C
NSLog(@"Harrison")
NSString *firstName = @"Harrison";
NSLog(firstName);
NSLog(@"Hello there, %@.", firstName);
NSLog(@"%@ %@", firstName, firstName);
NSString *lastName = @"Freni";
NSLog(@"%@ %@", firstName, lastName);
NSNumber *age = @16;
NSLog(@"%@ is %@ years old", firstName, age);
NSArray *apps = @[@"AngryFowl", @"Lettertouch", @"Tweetrobot"];