Beispiel #1
0
        /// <summary>
        /// This takes every frame received by the Leap Motion controller, and
        /// sends the Arduino a message using it.
        /// </summary>
        /// <param name="controller">The Leap Motion <c>Controller</c>.</param>
        public async override void OnFrame(Controller controller)
        {
            Frame frame = controller.Frame();

            var message = MotionToNotes.Convert(frame);

            if (ArduinoSendTask != null)
            {
                await ArduinoSendTask;
            }

            ArduinoSendTask = Arduino.SendAsync(message);
        }
Beispiel #2
0
 /// <summary>
 /// Creates a <c>LeapListener</c> that uses the given motion to notes
 /// converter, and the given <c>Arduino</c> interface controller.
 /// </summary>
 /// <param name="motionToNotes">The object to use to convert the Leap
 /// Motion data into notes.</param>
 /// <param name="arduino">The object to use to communicate with the
 /// Arduino.</param>
 public LeapListener(MotionToNotes motionToNotes, APS.Arduino.Arduino arduino)
 {
     MotionToNotes = motionToNotes;
     Arduino       = arduino;
 }