This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
modprobe libcomposite | |
mkdir -p /sys/kernel/config/usb_gadget/g | |
echo 0x1d6b > /sys/kernel/config/usb_gadget/g/idVendor # Linux Foundation | |
echo 0x0104 > /sys/kernel/config/usb_gadget/g/idProduct # Multifunction Composite Gadget | |
echo 0x0100 > /sys/kernel/config/usb_gadget/g/bcdDevice # v1.0.0 | |
echo 0x0200 > /sys/kernel/config/usb_gadget/g/bcdUSB # USB 2.0 | |
echo 0xef > /sys/kernel/config/usb_gadget/g/bDeviceClass # USB 2.0 | |
echo 0x02 > /sys/kernel/config/usb_gadget/g/bDeviceSubClass # USB 2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_package(PahoMqttCpp REQUIRED) | |
add_executable(data_publish data_publish.cpp) | |
# target_link_libraries(data_publish paho-mqtt3a paho-mqttpp3) | |
target_link_libraries(data_publish PahoMqttCpp::paho-mqttpp3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PIL import Image | |
if len(sys.argv) != 3: | |
print('Usage: python {} image.gif array.c'.format(sys.argv[0])) | |
sys.exit(1) | |
im = Image.open(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7 | |
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n | |
# Install Oracle JDK 8 | |
add-apt-repository ppa:webupd8team/java | |
apt-get update | |
apt-get install -y oracle-java8-installer | |
apt-get install -y unzip make # NDK stuff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
project(webrtc-audio-processing) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | |
add_definitions("-DWEBRTC_LINUX -DWEBRTC_POSIX -DWEBRTC_NS_FLOAT") | |
#-DWEBRTC_UNTRUSTED_DELAY | |
include_directories( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# Using dbus to detect new drive on linux | |
# Install dependences: sudo apt-get install python-dbus python-gobject | |
import dbus | |
import glib | |
from dbus.mainloop.glib import DBusGMainLoop | |
def handle_new_drive(sender, mount_id, data): | |
mounted_path = data[5][7:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# fix vector checksum value for NXP LPc1xxx | |
# | |
if [ $# != 1 ]; then | |
echo "Usage: $0 firmware.bin" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
BeagleBone Green Test | |
apt-get install build-essential python-dev python-setuptools python-pip python-smbus -y | |
pip install Adafruit_BBIO | |
''' | |
import Adafruit_BBIO.GPIO as GPIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// K type thermocouple conversion table - Celsius | |
// from -270 to 1372 | |
const float k_type_tc_table[] = { | |
/* ˚C -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 ˚C */ | |
/* -260 */ -6.458, -6.457, -6.456, -6.455, -6.453, -6.452, -6.45, -6.448, -6.446, -6.444, | |
/* -250 */ -6.441, -6.438, -6.435, -6.432, -6.429, -6.425, -6.421, -6.417, -6.413, -6.408, | |
/* -240 */ -6.404, -6.399, -6.393, -6.388, -6.382, -6.377, -6.37, -6.364, -6.358, -6.351, | |
/* -230 */ -6.344, -6.337, -6.329, -6.322, -6.314, -6.306, -6.297, -6.289, -6.28, -6.271, | |
/* -220 */ -6.262, -6.252, -6.243, -6.233, -6.223, -6.213, -6.202, -6.192, -6.181, -6.17, | |
/* -210 */ -6.158, -6.147, -6.135, -6.123, -6.111, -6.099, -6.087, -6.074, -6.061, -6.048, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, serial | |
import numpy as np | |
from collections import deque | |
from matplotlib import pyplot as plt | |
# class that holds data for N samples | |
class DataPoll: | |
# constr |
NewerOlder