Skip to content

Instantly share code, notes, and snippets.

View elbruno's full-sized avatar
💭
@Home rocking some AI projects

El Bruno elbruno

💭
@Home rocking some AI projects
View GitHub Profile
using System;
using InTheHand.Net.Sockets;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
var bluetoothClient = new BluetoothClient();
@elbruno
elbruno / PebbleButtonsHandlersSample
Last active August 29, 2015 14:01
Pebble Buttons Handlers Sample
#include <pebble.h>
Window *my_window;
TextLayer *text_layer;
void handle_init(void) {
my_window = window_create();
window_set_click_config_provider(window, click_config_provider);
text_layer = text_layer_create(GRect(0, 0, 144, 20));
window_stack_push(my_window, true);
@elbruno
elbruno / PebbleSampleButtons02
Created May 9, 2014 11:39
Pebble Sample Buttons 02
#include <pebble.h>
Window *window;
TextLayer *text_layer;
/* Buttons Handlers */
void up_click_handler(ClickRecognizerRef recognizer, void *context)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Button Up !");
@elbruno
elbruno / PebbleSampleButtons03
Created May 15, 2014 19:16
PebbleSampleButtons03
#include <pebble.h>
Window *window;
GBitmap *nino_bitmap;
BitmapLayer *nino_layer;
int imageYLocation;
int difY;
void on_animation_stopped(Animation *anim, bool finished, void *context)
{
@elbruno
elbruno / ArduinoAccelerometerLightStrip
Created May 17, 2014 10:52
ArduinoAccelerometerLightStrip
#include <Wire.h>
#include "MMA7660.h"
MMA7660 acc;
int brightness = 0; // how bright the LED is
int ledStrip = 6; // the pin that the LED is attached to
int accelerometer = 13; // the pin that the accelerometer sensor is attached
int fadeAmount = 5; // how many points to fade the LED by
void setup()
{
@elbruno
elbruno / AccelerometerSample01
Created May 27, 2014 19:59
AccelerometerSample01
#include <pebble.h>
#define MATH_PI 3.141592653589793238462
#define NUM_DISCS 20
#define DISC_DENSITY 0.25
#define ACCEL_RATIO 0.05
#define ACCEL_STEP_MS 50
Window *window;
TextLayer *text_layer;
static AppTimer *timer;
@elbruno
elbruno / ElBrunoLync2Pebble
Created May 28, 2014 11:59
ElBruno Lync to Pebble
static void Main()
{
WriteAppTitle();
if (ConnectToPebble()) return;
var client = LyncClient.GetClient();
client.ConversationManager.ConversationAdded += ConversationManager_ConversationAdded;
Console.WriteLine("Press Enter to exit.");
Console.ReadLine();
}
@elbruno
elbruno / ElBrunoLeapV2Controller
Created May 29, 2014 09:18
El Bruno - Leap V2 SDK Beta Controller
using System;
using System.Threading.Tasks;
using Leap;
namespace ElBruno.LeapV2NewFeatures
{
public class MotionListener : Listener
{
public event Action<bool, bool> OnLeftOrRightHand;
public event Action<float, float> OnPitchAndGrab;
@elbruno
elbruno / KinectSdkV2FrameLifeCycle
Created June 10, 2014 22:11
KinectSdk V2, be sure of lifecycle of objects
static void _bodyFrameReader_FrameArrived(object sender, BodyFrameArrivedEventArgs e)
{
var frame = e.FrameReference.AcquireFrame();
if (null == frame) return;
using (frame)
{
frame.GetAndRefreshBodyData(_bodies);
foreach (var body in _bodies)
@elbruno
elbruno / ElBrunoGetXBoxOnControllere
Created June 27, 2014 14:04
Sample code to get the DeviceInfo for a XBoxOne Controller
using System.Linq;
using DeviceManagement;
namespace ConsoleApplication2
{
class DeviceInspection
{
public DeviceInfo GetXBoxController()
{
// you need nuget pkg https://devicemgr.codeplex.com/