Skip to content

Instantly share code, notes, and snippets.

vector<int> ViconData::footswitchAnalogToVector(double analog_val) {
int sensor_count = 4;
float discrete_max = (float)pow(2.0, 4)-1;
float analog_max = 4;
int discrete_val = (int)floor(analog_val * discrete_max / analog_max + 0.5);
vector<int> ret;
for (int i = 0; i < sensor_count; i++) {
if (discrete_val&1)
ret.push_back(1);
@cabanm
cabanm / .gitconfig
Created February 9, 2017 10:48
Git lola
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
[color]
branch = auto
diff = auto
interactive = auto
status = auto