Code Monkey home page Code Monkey logo

mathemagica's Introduction

Mathemagica: Visualizing Mathematical Relations using Haptic Feedback

MIT 6.835 Term Project - LeapMotion + Haptic Feedback + Math Carlos Henríquez, Erica Yuen

Demo Video (links to YouTube)

Mathemagica Demo Video

Installation

Run npm install then node index.js to start serving the web app. It is recommended that you use NVM to run the project with Node 8.0.0 (npm 5.0.0). If you have NVM installed, run nvm run 8.0.0 index.js.

You will need to have access to a Leap Motion, an Arduino Micro and a few vibration motors. You will need to flash the Arduino with Standard Firmata, which is included in this directory under firm ino.

The software was developed on Windows 10 using the Windows Subsystem for Linux as the development environment. This affects how the system identifies the the port that the Arduino is connected to. You can find what port the Arduino is connected at by opening up the Arduino IDE and selecting Tools -> Serial Port. You should see something like COM5 as the port.

Node can't normally write to the COM ports from WSL, so you will need to sudo chmod 666 /dev/ttyS# where # is the COM port the arduino is connected at. If this is being launched not from a WSL command line such as Bash, setting the COM port variable in index.js should also work.

You will need to make sure that the Leap Service is also running in the background, otherwise the system will complain about the appropriate websocket not being open.

The current hardware is setup to use the index, middle, ring, and pinky fingers. The logic for adding a thumb exists and would just required adding a motor to one of Arduino Micro PWM pins: 3, 5, 6, 9, 10, 11 or 13 (source). Currently, pins 10, 9, 6 and 11 are mapped to the index, middle, ring, and pinky fingers, respectively. The pinout for the Arduino Micro is:

Arduino Micro pinout

List of files

.
├ firm_ino/
│   └ firm_ino.ino         // The Standard Firmata file with which to flash the Arduino
├ index.html               // The HTML for the web interface
├ index.js                 // The main server file
├ lib/                     // Libraries used for JavaScript dependencies
├ Mathemagica.pdf          // The project writeup
├ node_modules/            // Dependencies for the server
├ package.json             // Lists required packages
├ public/
│   ├ Detector.js          // Dependency for LeapCursor.js
│   ├ famous.css           // Some styling
│   ├ LeapCursor.js        // Handles to creation of the cursor and firing of custom events
│   ├ leap.min.js          // Leap JavaScript SDK
│   ├ leap-plugins.min.js  // Plugins for Leap.js, dependency for LeapCursor.js
│   ├ mathemagica.js       // Controller for the web app, communicates with the server
│   └ three.min.js         // Dependency for Leap.js
└ README.md

Debugging

Mathemagica can also be run without an Arduino for debugging purposes. Set useHardware = false; in index.js to interact with the web app without having to connect with to an Arduino.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.