Skip to content

Instantly share code, notes, and snippets.

View khanning's full-sized avatar

Kreg Hanning khanning

  • Cambridge, MA
View GitHub Profile
Privacy Policy
Kreg Hanning built the PicoPlay app as a Free app. This SERVICE is provided by Kreg Hanning at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at PicoPlay unless otherwise defined in this Privacy Policy.
Information Collection and Use
static void microbit_ble_configureAdvertising( bool connectable, bool discoverable, bool whitelist,
uint16_t interval_ms, int timeout_seconds)
{
ble_advdata_t advdata;
memset( &advdata, 0, sizeof( advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.flags = !whitelist && discoverable
? BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED | BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE
: BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
#include "MicroBit.h"
MicroBit uBit;
MicroBitSerial serial(USBTX, USBRX);
uint8_t lightLevel;
void lightLevelReady(MicroBitEvent) {
lightLevel = uBit.display.readLightLevel();
serial.send(lightLevel);
var noble = require('noble');
var SERVICE_UUID = "19b10000e8f2537e4f6cd104768a1214",
LED_CHAR = "19b10001e8f2537e4f6cd104768a1214";
var delay = 1000;
noble.on('stateChange', function(state) {
console.log(state);
if (state === 'poweredOn') {
/*
* Copyright (c) 2016 Intel Corporation. All rights reserved.
* See the bottom of this file for the license terms.
*/
/*
* Sketch: led.ino
*
* Description:
* This is a Peripheral sketch that works with a connected Central.
/*This program is free software: you can redistribute it 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.
*
var noble = require('noble');
var SERVICE_UUID = "19b10000e8f2537e4f6cd104768a1214",
LED_CHAR = "19b10001e8f2537e4f6cd104768a1214";
var delay = 500;
noble.on('stateChange', function(state) {
console.log(state);
if (state === 'poweredOn') {
@khanning
khanning / MotorMount.scad
Created June 3, 2016 13:37
Openscad script for DC hobby motor mount
BASE_HEIGHT = 4;
BASE_RADIUS = 10;
AXLE_HOLE_RADIUS = 1.45;
AXLE_HOLE_HEIGHT = 10;
AXLE_HEIGHT = 30;
WING_LENGTH = 25;
WING_WIDTH = 10;