Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Currently available for work. Let's talk!

Ron Evans deadprogram

💭
Currently available for work. Let's talk!
View GitHub Profile
package main
import (
"math"
"sync/atomic"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/joystick"
"gobot.io/x/gobot/platforms/parrot/ardrone"
package main
import (
"math"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/joystick"
"gobot.io/x/gobot/platforms/parrot/ardrone"
)
@deadprogram
deadprogram / sastoken.go
Last active December 19, 2021 16:43
Golang command line utility to generate Microsoft Azure SAS tokens for Azure IoT Hub
// Golang command line utility to generate an Microsoft Azure SAS token for use
// with the MS Azure IoT Hub.
//
// USAGE: USAGE: sastoken <URI> <key> <expiresInMins> [policy]
//
// Copyright © 2016 The Hybrid Group (http://hybridgroup.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the “Software”), to deal
// in the Software without restriction, including without limitation the rights
Mon, 07 Mar 2016 19:47:05 GMT hci setting filter to: 1400000020c10000000000400000
Mon, 07 Mar 2016 19:47:05 GMT hci set event mask - writing: 01010c08fffffbff07f8bf3d
Mon, 07 Mar 2016 19:47:05 GMT hci set le event mask - writing: 010120081f00000000000000
Mon, 07 Mar 2016 19:47:05 GMT hci read local version - writing: 01011000
Mon, 07 Mar 2016 19:47:05 GMT hci write LE host supported - writing: 016d0c020100
Mon, 07 Mar 2016 19:47:05 GMT hci read LE host supported - writing: 016c0c00
Mon, 07 Mar 2016 19:47:05 GMT hci read bd addr - writing: 01091000
beginning
Mon, 07 Mar 2016 19:47:05 GMT hci onSocketData: 040e0402010c00
Mon, 07 Mar 2016 19:47:05 GMT hci event type = 4
$ node examples/takeoff-events.js
ready
{}
FlyingStateChanged
takingOff
takingOff
BatteryStateChanged
28
BatteryStateChanged
27
$ DEBUG=* node node_modules/noble/examples/peripheral-explorer.js 207377654321 > wiced-debug.log
hci setting filter to: 1400000020c10000000000400000 +0ms
hci set event mask - writing: 01010c08fffffbff07f8bf3d +3ms
hci set le event mask - writing: 010120081f00000000000000 +1ms
hci read local version - writing: 01011000 +0ms
hci write LE host supported - writing: 016d0c020100 +0ms
hci read LE host supported - writing: 016c0c00 +1ms
hci read bd addr - writing: 01091000 +0ms
hci onSocketData: 040e0401010c00 +1ms
hci event type = 4 +0ms
"use strict";
var Cylon = require("cylon");
Cylon.robot({
connections: {
leap: { adaptor: "leapmotion" },
arduino: { adaptor: "firmata", port: "/dev/tty.usbmodem1411" }
},
root@cylon13:~/mraa/build# make
[ 28%] Built target mraa
[ 30%] Building CXX object src/javascript/CMakeFiles/mraajs.dir/mraajsJAVASCRIPT_wrap.cxx.o
In file included from /usr/local/include/node/node.h:42:0,
from /home/root/mraa/build/src/javascript/mraajsJAVASCRIPT_wrap.cxx:156:
/usr/local/include/node/v8.h:336:1: error: expected unqualified-id before 'using'
using Handle = Local<T>;
^
/usr/local/include/node/v8.h: In constructor 'v8::MaybeLocal<T>::MaybeLocal()':
/usr/local/include/node/v8.h:353:33: error: 'nullptr' was not declared in this scope
Cylon.robot({
connections: {
ollie: { adaptor: "central", uuid: process.env["OLLIE"], module: "cylon-ble" },
ircannon: { adaptor: 'central', uuid: process.env["CANNON"], module: 'cylon-ble' }
},
devices: {
ollie: { driver: "ollie", connection: "ollie", module: "cylon-sphero-ble" },
fire: { driver: 'ble-characteristic',
serviceId: "a495ff20c5b14b44b5121370f02d74de",
characteristicId: "a495ff22c5b14b44b5121370f02d74de",
func (h *MPU6050Driver) initialize() (err error) {
if err = h.connection.I2cStart(mpu6050Address); err != nil {
return
}
// setClockSource
if err = h.connection.I2cWrite(mpu6050Address, []byte{MPU6050_RA_PWR_MGMT_1,
MPU6050_PWR1_CLKSEL_BIT,
MPU6050_PWR1_CLKSEL_LENGTH,
MPU6050_CLOCK_PLL_XGYRO}); err != nil {