Skip to content

Instantly share code, notes, and snippets.

View fraguada's full-sized avatar

Luis E. Fraguada fraguada

View GitHub Profile
@fraguada
fraguada / test.js
Created January 19, 2015 11:22
Basic Cube
{
"metadata": {
"formatVersion": 3,
"sourceFile": "this",
"generatedBy": "this",
"vertices": 8,
"normals": 8,
"faces": 12,
"colors": 0,
"uvs": 0,
@fraguada
fraguada / JSON Icosahedron
Created January 25, 2015 23:03
JSON Output of a mesh with vertex normals and colors
{
"metadata": {
"formatVersion": 3.1,
"sourceFile": "this",
"generatedBy": "this",
"vertices": 12,
"normals": 12,
"faces": 20,
"colors": 12,
"uvs": 0,
@fraguada
fraguada / Test83.js
Last active August 29, 2015 14:14
JSON Scene Format 4.3
{
"metadata": {
"version": 4.3,
"type": "Object",
"generator": "MyApp"
},
"geometries": [
{
"uuid": "8ae9fe0f-b41e-4b1e-8bda-397f75cbe68a",
"type": "Geometry",
@fraguada
fraguada / pcinfo.cs
Created July 29, 2012 17:47
Point Cloud Attributes
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
RhinoApp.WriteLine("The {0} command will get info from a pt cloud.", EnglishName);
Rhino.DocObjects.ObjRef obref;
Rhino.Commands.Result rc = Rhino.Input.RhinoGet.GetOneObject("Select point cloud object", true, Rhino.DocObjects.ObjectType.PointSet, out obref);
if (rc != Rhino.Commands.Result.Success)
return rc;
Rhino.DocObjects.RhinoObject rhobj = obref.Object();
if (rhobj == null)
@fraguada
fraguada / LPD8806_Fader.ino
Last active December 11, 2015 04:48
A quick attempt at fading from solid color to none...
//adapted from LEDneltKit written bu Adafruit and found here:
//https://github.com/adafruit/LPD8806/tree/master/examples/LEDbeltKit
//Fades a color in and out
//2013.06.04 - Luis E. Fraguada
//looking for suggestions!
#include "LPD8806.h"
#include "SPI.h"
int dataPin = 16;
@fraguada
fraguada / MainActivity
Last active December 17, 2015 23:59
Just trying to send RGB values via three sliders in an Android App. I do not understand how many bytes I need to send as Latch.
package ioio.bosioio;
import ioio.lib.api.SpiMaster;
import ioio.lib.api.exception.ConnectionLostException;
import ioio.lib.util.BaseIOIOLooper;
import ioio.lib.util.IOIOLooper;
import ioio.lib.util.android.IOIOActivity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.SeekBar;
@fraguada
fraguada / kind of asynchronous, but not really
Created September 15, 2013 20:34
Proof of concept for running multiple sequences on Neopixel LED strips. By no means optimized or clever...
//testing RTOS for multiple neopixel strips
//ChibiOS for Arduino sourced from: http://code.google.com/p/rtoslibs/
#include <ChibiOS_AVR.h>
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(3, 8, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(3, 9, NEO_GRB + NEO_KHZ800);
uint8_t wait = 100;
uint8_t r = 255;
@fraguada
fraguada / gist:71456b09cf585c57206a52814e93c2ce
Created September 3, 2016 15:34
PyMetawear Neopixel Simple
from pymetawear import libmetawear
from pymetawear.client import MetaWearClient
c = MetaWearClient('XX:XX:XX:XX:XX:XX', 'pygatt', debug=True)
print("New client created: {0}".format(c))
#args board, strand, pin, #pixels, color order
libmetawear.mbl_mw_neopixel_init_slow_strand(c.board, 0, 0, 1, 0)
#args board, strand, pixel id, r, g, b
from pymetawear import libmetawear
from pymetawear.client import MetaWearClient
#from http://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
@fraguada
fraguada / scene.json
Created March 18, 2017 20:59
Test File for #9905
{
"metadata" : {
"version" : 4.3,
"type" : "Object",
"generator" : "Iris for Rhinoceros"
},
"fonts" : [{
"uuid" : "d03772e6-7c7e-49e9-aa86-1a6d09aa1e33",
"glyphs" : { "glyphs": { "ο": { "x_min": 0, "x_max": 712, "ha": 815, "o": "m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 " }, "S": { "x_min": 0, "x_max": 788, "ha": 890, "o": "m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 " }, "¦": { "x