From 8d5dd4ec6d3cb5d368a7fe6f1d114d594a63517c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 5 Dec 2013 16:44:41 -0800 Subject: [PATCH] remove the hardware directory --- hardware/head_hand/head_hand.pde | 81 -------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 hardware/head_hand/head_hand.pde diff --git a/hardware/head_hand/head_hand.pde b/hardware/head_hand/head_hand.pde deleted file mode 100644 index 844f352e56..0000000000 --- a/hardware/head_hand/head_hand.pde +++ /dev/null @@ -1,81 +0,0 @@ -// -// Read Gyro and accelerometer data, send over serialUSB to computer for processing. -// -// Written by Philip, 2012, for High Fidelity, Inc. -// -// PIN WIRING: Connect input sensors to the channels in following manner -// -// AIN 10: Yaw Gyro (shaking your head 'no') -// AIN 16: Pitch Gyro (nodding your head 'yes') -// AIN 17: Roll Gyro (looking quizzical, tilting your head) -// AIN 18: Lateral acceleration (moving from side-to-side in front of your monitor) -// AIN 19: Up/Down acceleration (sitting up/ducking in front of your monitor) -// AIN 20: Forward/Back acceleration (Toward or away from your monitor) - -#define NUM_CHANNELS 6 -#define MSECS_PER_SAMPLE 10 - -#define LED_PIN 12 - -int inputPins[NUM_CHANNELS] = {10,16,17,18,19,20}; - -int LED = 0; -unsigned int samplesSent = 0; -unsigned int time; - -int measured[NUM_CHANNELS]; -float accumulate[NUM_CHANNELS]; - -int sampleCount = 0; - -void setup() -{ - int i; - for (i = 0; i < NUM_CHANNELS; i++) { - pinMode(inputPins[i], INPUT_ANALOG); - measured[i] = analogRead(inputPins[i]); - accumulate[i] = measured[i]; - } - pinMode(BOARD_LED_PIN, OUTPUT); - pinMode(LED_PIN,OUTPUT); - time = millis(); -} - -void loop() -{ - int i; - sampleCount++; - - for (i = 0; i < NUM_CHANNELS; i++) { - accumulate[i] += analogRead(inputPins[i]); - } - if ((millis() - time) >= MSECS_PER_SAMPLE) { - samplesSent++; - time = millis(); - for (i = 0; i < NUM_CHANNELS; i++) { - measured[i] = accumulate[i] / sampleCount; - SerialUSB.print(measured[i]); - SerialUSB.print(" "); - accumulate[i] = 0; - } - - if ((samplesSent % 100 == 0) && (samplesSent % 150 == 0)) { - LED = !LED; - digitalWrite(LED_PIN, LED); - digitalWrite(BOARD_LED_PIN, LED); - } - - SerialUSB.print(sampleCount); - SerialUSB.print(" "); - if (LED) - SerialUSB.print("1"); - else - SerialUSB.print("0"); - - SerialUSB.println(""); - sampleCount = 0; - } -} - - -