Skip to content

Instantly share code, notes, and snippets.

Sandeep Mistry sandeepmistry

  • Ottawa
Block or report user

Report or block sandeepmistry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mqtt_send_digital.ino
/*
This example connects to a WPA encrypted WiFi network,
using the WiFi Shield 101.
Then connects to the Arduino Cloud MQTT broker using
SSL, and sends updates on the status of an LED which
is controlled by a button.
Circuit:
* WiFi shield attached
@sandeepmistry
sandeepmistry / uri-beacon-test.js
Last active Aug 29, 2015
node URI Beacon Scanner
View uri-beacon-test.js
var UriBeacon = require('./uri-beacon');
UriBeacon.on('discover', function(uriBeacon) {
console.log('discovered: ' + JSON.stringify(uriBeacon, null, 2));
});
UriBeacon.startScanning();
@sandeepmistry
sandeepmistry / led_callback_nRF51822_low_power.ino
Last active Mar 25, 2019
BLEPeripheral nRF51822 - Low Power (Interrupt) Example
View led_callback_nRF51822_low_power.ino
// Import libraries (BLEPeripheral depends on SPI)
#include <SPI.h>
#include <BLEPeripheral.h>
// define pins (varies per shield/board)
#define BLE_REQ 10
#define BLE_RDY 2
#define BLE_RST 9
// LED pin
View BLEPeripheral_NeoPixel.ino
// Import libraries (BLEPeripheral depends on SPI)
#include <SPI.h>
#include <BLEPeripheral.h>
#include <Adafruit_NeoPixel.h>
// define pins (varies per shield/board)
#define BLE_REQ 10
#define BLE_RDY 2
#define BLE_RST 9
@sandeepmistry
sandeepmistry / mwc-challenge-2014.js
Created Feb 12, 2014
node.js script to mimic the iBeacons at Mobile World Congress 2014 - http://mwc.mobisfera.com
View mwc-challenge-2014.js
var bleno = require('bleno');
var uuid = 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'.replace(/-/g, '');
var major = 21047;
var minorStart = 0;
var minorEnd = 5;
var measuredPower = -59;
console.log("MWC Scavenger Hunt");
@sandeepmistry
sandeepmistry / yun.js
Created Feb 11, 2014
Arduino Yun: bleno + johnny-five
View yun.js
var util = require('util');
var bleno = require('bleno');
var five = require("johnny-five");
var BlenoPrimaryService = bleno.PrimaryService;
var BlenoCharacteristic = bleno.Characteristic;
var BlenoDescriptor = bleno.Descriptor;
var board = new five.Board({
@sandeepmistry
sandeepmistry / advertisement-discovery.js
Last active Jul 17, 2018
noble scan, and advertisement info print out on discovery.
View advertisement-discovery.js
var noble = require('noble');
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning();
} else {
noble.stopScanning();
}
});
@sandeepmistry
sandeepmistry / humidity.js
Last active Dec 20, 2015
node.js TI SensorTag humidity sensor example.
View humidity.js
var SensorTag = require('sensortag');
SensorTag.discover(function(sensorTag) {
console.log('discover');
sensorTag.connect(function() {
console.log('connect');
sensorTag.discoverServices(function() {
console.log('discoverServices');
sensorTag.discoverCharacteristics(function() {
console.log('discoverCharacteristics');
@sandeepmistry
sandeepmistry / output.txt
Created Apr 7, 2013
dbus-native BlueZ unmarshall error
View output.txt
{ name: '/',
service:
{ name: 'org.bluez',
bus:
{ connection: [Object],
serial: 2,
cookies: [Object],
methodCallHandlers: {},
signals: [Object],
exportedObjects: {},
View gist:5288912
var noble = require('noble');
var main = function() {
noble.on('stateChange', function(state) {
console.log('stateChange: ' + state);
if (state === 'poweredOn') noble.startScanning(); else noble.stopScanning();
});
noble.on('peripheralDiscover', function(peripheral) {
You can’t perform that action at this time.