Skip to content

Instantly share code, notes, and snippets.

View rbtr's full-sized avatar
🛰️
heat on high until hot

Evan Baker rbtr

🛰️
heat on high until hot
View GitHub Profile
// Inverted pendulum (self balancing robot)
int i = 0; // Iteration counter
byte countS = 0; // ??
double zeroOmegaI = 0; // ??
double recOmegaI[10]; // ??
double omegaI = 0; // Rotational velocity
double thetaI = 0; // Rotational angle
double sumPower = 0; // ??
double sumSumP = 0; // ??
const double kAngle = 2.5; // (54/200)
@rbtr
rbtr / File IO Hello World
Last active August 29, 2015 14:19
FIO Hello World for workshop
package csc171.workshop;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException, FileNotFoundException {
// P1
writeHelloWorld();
readHelloWorld();
@rbtr
rbtr / ScreenSizeUtils.java
Created April 14, 2015 02:42
A Screen Size Utility Class for Android
/**
* This class is just a helper package to get the screen dimensions
*/
public class ScreenSizeUtils {
// helper classes
private Context mContext;
private WindowManager mWm;
private Display mDisplay;
private Configuration mConfig;
@rbtr
rbtr / Count to 10 Game
Last active August 29, 2015 14:18
MATLAB code for a 2 player count to 10 game.
clc
sum = 0;
player = 1;
while (sum < 10)
choice = -1;
fprintf('Player %i\n', player);