Merge pull request #1333 from birarda/master

remove the hardware directory
This commit is contained in:
Andrzej Kapolka 2013-12-05 17:05:34 -08:00
commit 0ffdc9ba16
4 changed files with 5 additions and 238 deletions

View file

@ -1,82 +0,0 @@
# - Try to find jack-2.6
# Once done this will define
#
# JACK_FOUND - system has jack
# JACK_INCLUDE_DIRS - the jack include directory
# JACK_LIBRARIES - Link these to use jack
# JACK_DEFINITIONS - Compiler switches required for using jack
#
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
# Modified for other libraries by Lasse Kärkkäinen <tronic>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# in cache already
set(JACK_FOUND TRUE)
else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_JACK jack)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(JACK_INCLUDE_DIR
NAMES
jack/jack.h
PATHS
${_JACK_INCLUDEDIR}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
find_library(JACK_LIBRARY
NAMES
jack
PATHS
${_JACK_LIBDIR}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
if (JACK_LIBRARY AND JACK_INCLUDE_DIR)
set(JACK_FOUND TRUE)
set(JACK_INCLUDE_DIRS
${JACK_INCLUDE_DIR}
)
set(JACK_LIBRARIES
${JACK_LIBRARIES}
${JACK_LIBRARY}
)
endif (JACK_LIBRARY AND JACK_INCLUDE_DIR)
if (JACK_FOUND)
if (NOT JACK_FIND_QUIETLY)
message(STATUS "Found jack: ${JACK_LIBRARY}")
endif (NOT JACK_FIND_QUIETLY)
else (JACK_FOUND)
if (JACK_FIND_REQUIRED)
message(FATAL_ERROR "Could not find JACK")
endif (JACK_FIND_REQUIRED)
endif (JACK_FOUND)
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES)
endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)

View file

@ -1,61 +0,0 @@
# You may redistribute this program and/or modify it under the terms of
# the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if(NOT LIBRT_FOUND)
find_path(LIBRT_INCLUDE_DIR
NAMES
time.h
PATHS
${LIBRTDIR}/include/
)
find_file(
LIBRT_LIBRARIES librt.a
PATHS
${LIBRTDIR}/lib/
/usr/local/lib64/
/usr/local/lib/
/usr/lib/i386-linux-gnu/
/usr/lib/x86_64-linux-gnu/
/usr/lib64/
/usr/lib/
)
set (LIBRT_DYNAMIC "Using static library.")
if (NOT LIBRT_LIBRARIES)
find_library(
LIBRT_LIBRARIES rt
PATHS
${LIBRTDIR}/lib/
/usr/local/lib64/
/usr/local/lib/
/usr/lib/i386-linux-gnu/
/usr/lib/x86_64-linux-gnu/
/usr/lib64/
/usr/lib/
)
set (LIBRT_DYNAMIC "Using dynamic library.")
endif (NOT LIBRT_LIBRARIES)
if (LIBRT_INCLUDE_DIR AND LIBRT_LIBRARIES)
set (LIBRT_FOUND TRUE)
endif (LIBRT_INCLUDE_DIR AND LIBRT_LIBRARIES)
if (LIBRT_FOUND)
message(STATUS "Found librt: ${LIBRT_INCLUDE_DIR}, ${LIBRT_LIBRARIES} ${LIBRT_DYNAMIC}")
else (LIBRT_FOUND)
if (Librt_FIND_REQUIRED)
message (FATAL_ERROR "Could not find librt, try to setup LIBRT_PREFIX accordingly")
endif (Librt_FIND_REQUIRED)
endif (LIBRT_FOUND)
endif (NOT LIBRT_FOUND)

View file

@ -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;
}
}

View file

@ -157,8 +157,6 @@ target_link_libraries(
if (APPLE)
# link in required OS X frameworks and include the right GL headers
find_library(AppKit AppKit)
find_library(AudioToolbox AudioToolbox)
find_library(AudioUnit AudioUnit)
find_library(CoreAudio CoreAudio)
find_library(CoreServices CoreServices)
find_library(Carbon Carbon)
@ -174,8 +172,6 @@ if (APPLE)
target_link_libraries(
${TARGET_NAME}
${AppKit}
${AudioToolbox}
${AudioUnit}
${CoreAudio}
${CoreServices}
${Carbon}
@ -212,15 +208,10 @@ else (WIN32)
# link required libraries on UNIX
if (UNIX AND NOT APPLE)
find_package(Threads REQUIRED)
find_package(Librt REQUIRED)
find_package(ALSA)
find_package(Jack)
target_link_libraries(${TARGET_NAME}
target_link_libraries(
${TARGET_NAME}
${CMAKE_THREAD_LIBS_INIT}
${LIBRT_LIBRARIES}
${JACK_LIBRARIES}
${ALSA_LIBRARIES}
${GLUT_LIBRARY}
)
endif (UNIX AND NOT APPLE)