This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static MoveDirections CalculateDirectionY(float y, int yCoeficient) | |
{ | |
var locationY = MoveDirections.DownFar; | |
var currentLocationY = y * yCoeficient; | |
if (currentLocationY > 20000) | |
{ | |
locationY = MoveDirections.UpFar; | |
} | |
else if (currentLocationY > 10000) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ProcessMovements(MoveDirection moveDirection, bool fire) | |
{ | |
switch (moveDirection.CombinedXy) | |
{ | |
case MoveDirections.Center: | |
_rocket.StopMovements(); | |
break; | |
case MoveDirections.Left: | |
case MoveDirections.LeftFar: | |
_rocket.MoveLeft(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override System.Threading.Tasks.Task OnConnected() | |
{ | |
// some weird stuff here | |
return base.OnConnected(); | |
} | |
public void JoinToArea(string area) | |
{ | |
Groups.Add(Context.ConnectionId, area); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var hub; | |
$(window).ready(function () { | |
console.log("windows ready para SignalR"); | |
hub = $.connection.SampleHub; | |
$.connection.hub.start().done( | |
function () { | |
var area = 'default'; | |
console.log("hub started, area:" + area); | |
hub.server.JoinToArea(area); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var hub; | |
$(window).ready(function () { | |
console.log("windows ready para SignalR"); | |
hub = $.connection.SampleHub; | |
// dummy call to force the [OnConnected()] method on signalR hub | |
hub.client.foo = function () { }; | |
$.connection.hub.start().done( | |
function () { | |
var area = 'default'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void Main() | |
{ | |
BluetoothAddress arduinoAdress = null; | |
_blueToothClient = new BluetoothClient(); | |
var devices = _blueToothClient.DiscoverDevices(); | |
foreach (var device in devices.Where(device => device.DeviceName == "IoT Arduino - Mainframe Bridge")) | |
{ | |
arduinoAdress = device.DeviceAddress; | |
Console.WriteLine("Device found, Address:" + arduinoAdress.ToString()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pebble.h> | |
static Window *window; | |
static TextLayer *text_layer; | |
enum { | |
KEY_EXCHANGEDATA = 0, | |
}; | |
// END Interaction with JS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>@ViewBag.Title</title> | |
@Styles.Render("~/Content/css") | |
</head> | |
<body> | |
<h2>El Bruno - LeafLet demo 01</h2> |