GithubHelp home page GithubHelp logo

imclab / wearscript-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wearscript/wearscript-android

0.0 2.0 0.0 55.18 MB

JavaScript with Batteries Included for Google Glass

Home Page: wearscript.com

wearscript-android's Introduction

WearScript

WearScript combines the power of Android development on Glass with the learning curve of a website. Go from concept to demo in a fraction of the time. For an overview check out the intro video and sample script below. Visit http://www.wearscript.com for documentation and more information.

intro video

// Sample WearScript
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function cb(data) {  // Changes canvas color depending on head rotation
    if (data['type'] == WS.sensor('orientation')) {
        ctx.fillStyle = 'hsl(' + data['values'][0] + ', 90%, 50%)'
        ctx.fillRect(0, 0, 640, 360);
    }
}
function server() {
    WS.log('Welcome to WearScript');  // Write to Android Log and Playground console
    WS.say('Welcome to WearScript');  // Text-to-speech
    // Stream camera images and all sensors to the WearScript Playground Webapp
    var sensors = ['gps', 'accelerometer', 'magneticField', 'orientation', 'gyroscope',
                   'light', 'gravity', 'linearAcceleration', 'rotationVector'];
    for (var i = 0; i < sensors.length; i++)
        WS.sensorOn(WS.sensor(sensors[i]), .15, 'cb');
    WS.cameraOn(2);
    WS.dataLog(false, true, .15);
}
function main() {
    if (WS.scriptVersion(0)) return;
    ctx = document.getElementById('canvas').getContext("2d");
    WS.serverConnect('{{WSUrl}}', 'server');
}
window.onload = main;
</script></body></html>

About

  • Full documentation at http://www.wearscript.com
  • OpenShades (the new OpenGlass) is our community
  • IRC freenode #openshades (if you want to collaborate or chat that's the place to be)
  • Project Lead: Brandyn White (bwhite dappervision com)
  • G+ Community (we post work in progress here)
  • Youtube (all OpenShades videos)
  • Dapper Vision, Inc. (by Brandyn and Andrew) is the sponsor of this project
  • Code is licensed under Apache 2.0 unless otherwise specified

Contributors

See contributors for details. Name (irc nick)

  • Brandyn White (brandyn)
  • Andrew Miller (amiller)
  • Scott Greenwald (swgreen_mit)
  • Kurtis Nelson (kurtisnelson)
  • Conner Brooks (connerb)
  • Justin Chase (jujuman)
  • Alexander Conroy (geilt)

wearscript-android's People

Contributors

colegleason avatar connerbrooks avatar coryk135 avatar deadprogram avatar jujum4n avatar kurtisnelson avatar lrvick avatar mikedg1 avatar scottgwald avatar timothyclemans avatar

Watchers

 avatar  avatar

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.