This file contains hidden or 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
$include /etc/hotplug2-common.rules | |
SUBSYSTEM ~~ (^net$|input$|^button$|^usb$|^ieee1394$|^block$|^atm$|^zaptel$|tty$) { | |
exec /sbin/hotplug-call %SUBSYSTEM% | |
} | |
DEVICENAME == watchdog { | |
exec /sbin/watchdog -t 5 /dev/watchdog | |
next-event | |
} |
This file contains hidden or 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
#include <SoftwareSerial.h> | |
// Pins' connection | |
// Arduino WiFly | |
// 2 <----> TX | |
// 3 <----> RX | |
SoftwareSerial wifly(2, 3); | |
void readWiFlyOutput() | |
{ |
This file contains hidden or 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
/** | |
* led_breath.ino | |
* Use PWM to change LED's brightness | |
* Mode: | |
* Quadratic curve | |
* Linearity | |
*/ | |
#define NOT_USE_LINEARITY 1 |
This file contains hidden or 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
#include "mbed.h" | |
#include "USBKeyboard.h" | |
BusOut leds(LED1, LED2, LED3); //LED1: NUM_LOCK, LED2: CAPS_LOCK, LED3: SCROLL_LOCK | |
USBKeyboard keyboard; | |
int main(void) { | |
while (!keyboard.configured()) { // wait until keyboard is ready | |
} | |
This file contains hidden or 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
''' | |
Use custom CMSIS DAP debug adapter with pyOCD | |
''' | |
from time import sleep | |
from random import randrange | |
from pyOCD.interface import INTERFACE, usb_backend | |
from pyOCD.board import MbedBoard |
This file contains hidden or 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
GCC_BIN = | |
LIBRARY = ble_api | |
SRC_DIR := common public services | |
BUILD_DIR := $(addprefix build/,$(SRC_DIR)) | |
SRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp)) | |
OBJ := $(patsubst %.cpp,build/%.o,$(SRC)) |
This file contains hidden or 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 configuration | |
# | |
# Please refer to http://www.cmake.org/cmake/help/documentation.html | |
# You may also refer to http://www.cmake.org/cmake/help/syntax.html for a quick | |
# introduction to CMake's syntax. | |
cmake_minimum_required (VERSION 2.8) | |
# The name of our project is "NODE". CMakeLists files in this project can |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 |
OlderNewer