Skip to content

Lucky-Orange/BlackHawk-Plugin-Accelerometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BlackHawk-Plugin-Accelerometer

Accelerometer plugin of BlackHawk.

##Install

  1. Copy js/Accelerometer.js into www/plugins directory in your project.
  2. Drag swift/Accelerometer.swift into your Xcode project.
  3. add "Accelerometer" to the params of self.runPluginJS(["Base"]) in BlackHawkViewController class.

##Use

// js code
function accelerometerOnSuccess(acceleration) {
    alert('Acceleration X: ' + acceleration.x + '\n' +
          'Acceleration Y: ' + acceleration.y + '\n' +
          'Acceleration Z: ' + acceleration.z + '\n' +
          'Timestamp: '      + acceleration.timestamp + '\n');
};
function accelerometerOnError(e) {
    alert(e);
};
// get current acceleration
navigator.accelerometer.getCurrentAcceleration(accelerometerOnSuccess, accelerometerOnError);

##LICENSE BlackHawk is open-sourced software licensed under the MIT license.

Copyright (c) 2015 Leqicheng Inc. 乐其橙科技(北京)有限公司

About

Accelerometer plugin of BlackHawk.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published