Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rosterloh's full-sized avatar

Richard Osterloh rosterloh

View GitHub Profile
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))
@mbientlab
mbientlab / OfflineEventHandler.java
Last active August 29, 2015 14:10
Example using the event interface to program a MetaWear board
import com.mbientlab.metawear.api.MetaWearBleService;
import com.mbientlab.metawear.api.MetaWearController;
import com.mbientlab.metawear.api.MetaWearController.DeviceCallbacks;
import com.mbientlab.metawear.api.Module;
import com.mbientlab.metawear.api.controller.Accelerometer;
import com.mbientlab.metawear.api.controller.Accelerometer.Axis;
import com.mbientlab.metawear.api.controller.Accelerometer.TapType;
import com.mbientlab.metawear.api.controller.Event;
import com.mbientlab.metawear.api.controller.LED;
import com.mbientlab.metawear.api.controller.LED.ColorChannel;
@mbientlab
mbientlab / CallbackEventHandler.java
Last active August 29, 2015 14:10
Example for programming the MetaWear with callback functions
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import com.mbientlab.metawear.api.MetaWearBleService;
import com.mbientlab.metawear.api.MetaWearController;
import com.mbientlab.metawear.api.MetaWearController.DeviceCallbacks;
import com.mbientlab.metawear.api.Module;
import com.mbientlab.metawear.api.controller.Accelerometer;
import com.mbientlab.metawear.api.controller.Accelerometer.Axis;
@mbientlab
mbientlab / LoggingExample.java
Last active August 29, 2015 14:13
Full example on how to use the logger in the Android API
package com.mbientlab.metwear.app.sample;
import java.util.Arrays;
import java.util.Date;
import com.mbientlab.metawear.api.controller.Accelerometer;
import com.mbientlab.metawear.api.controller.Accelerometer.SamplingConfig;
import com.mbientlab.metawear.api.controller.Logging;
import com.mbientlab.metawear.api.controller.Logging.LogEntry;
import com.mbientlab.metawear.api.controller.Logging.ReferenceTick;
@tralamazza
tralamazza / .gdbinit
Last active August 29, 2015 14:23
ARMv7 exception helper
define armex
if $lr & 0xd == 0xd
printf "Uses PSP 0x%x return.\n", $PSP
set $armex_base = $PSP
else
printf "Uses MSP 0x%x return.\n", $MSP
set $armex_base = $MSP
end
printf "xPSR 0x%x\n", *($armex_base+28)
@bennadel
bennadel / localstorage.htm
Created July 10, 2015 11:13
Encapsulating LocalStorage Access In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Encapsulating LocalStorage Access In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@rosterloh
rosterloh / bb-python-gpio-test.py
Created March 7, 2012 10:11 — forked from mrichardson23/bb-python-gpio-test.py
BeagleBone GPIO with Python Test
#!/usr/bin/python
import time
# Open up the pins and set mode in/out
# TODO: Error handling
outPin = file("/sys/class/gpio/export", "w")
outPin.write("%d" % (38))
outPin.close()
outPin = file("/sys/class/gpio/gpio38/direction", "w")
@shiftkey
shiftkey / git-for-windows-rc.md
Last active October 27, 2015 19:09
Git for Windows - Request for Beta Testers

Git for Windows - Beta Testers Guide

The Git for Windows team is currently testing their newest release candidates, which is a port of Git 2.3 to Windows. As this is a significant change, I've written up a guide for people who are interested in helping to test out things.

Recommended Setup

You can find the latest releases for Git for Windows over on the Releases page:

https://github.com/git-for-windows/git/releases

@Fabryz
Fabryz / node-pilite.js
Last active December 20, 2015 20:18
Control the Pi Lite with Node.js $ npm install serialport $ node server.js
/*
* Description: Control the Pi Lite via Node.js
* Author: Fabrizio Codello (fabryz.com)
*
* TODO: Check if writing out of bounds
*/
var SerialPort = require("serialport").SerialPort;
// http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/280#Using the Pi-Lite pre-loaded software
/*
Copyright 2016-2017 Paul Trebilcox-Ruiz
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software