Skip to content

Instantly share code, notes, and snippets.

View fraguada's full-sized avatar

Luis E. Fraguada fraguada

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / Edit Light Properties Rhino
Created November 18, 2012 11:55
Small example method to edit Rhino light properties
private void RunScript(Guid id, Color col, double pow, ref object A)
{
Rhino.DocObjects.ObjRef obj = new Rhino.DocObjects.ObjRef(id);
Rhino.DocObjects.LightObject lobj = obj.Object() as Rhino.DocObjects.LightObject;
lobj.LightGeometry.Diffuse = col;
lobj.LightGeometry.Intensity = pow;
lobj.CommitChanges();
}
@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)