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 / 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 / ElBrunoWpfViewXboxOneController
Created June 27, 2014 17:18
El Bruno - WPF View display XBoxOne Controller state
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Threading;
using SharpDX.XInput;
namespace ElBruno.GameController
{
public partial class MainWindow : INotifyPropertyChanged
@elbruno
elbruno / ElBrunoKW4V2Speech
Created July 2, 2014 14:47
El Bruno - Kinect V2 SDK Speech demo
private void WindowLoaded(object sender, RoutedEventArgs e)
{
kinectSensor = KinectSensor.GetDefault();
kinectSensor.Open();
var audioBeamList = kinectSensor.AudioSource.AudioBeams;
var audioStream = audioBeamList[0].OpenInputStream();
convertStream = new KinectAudioStream(audioStream);
Var ri = GetKinectRecognizer();
recognitionSpans = new List<Span> { forwardSpan, backSpan, rightSpan, leftSpan };