Coder Social home page Coder Social logo

shalecraig / accel Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 3.0 1.76 MB

Accel is a simple library written in C that uses accelerometer data to find gestures in realtime.

License: MIT License

CMake 0.49% Shell 9.01% C++ 83.96% Makefile 0.14% Python 5.02% C 1.37%

accel's People

Contributors

asgaro avatar shalecraig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

accel's Issues

Ask for callback method for when affinities are hit.

Decide between:

  • Call when total affinity drops below minimum.
  • Call when affinity/frames in template drops below the minimum.

Requirements:

  • Write tests.
  • accel_find_most_likely_gesture can be called at almost any time.
  • Typedef the function as having the name accel_callback_found.
  • accel_generate_state should take an additional nullable parameter of accel_callback_found.
  • A NULL accel_callback_found implies the user will call the accel_find_most_likely_gesture method themselves.
  • Setup ACCEL_MIN_RESERVED.

The callback's signature is as follows:

int accel_callback(accel_state* state, const int gesture_id, int affinity, bool *reset_gesture);

We guarantee that:

  • Neither pointer passed to accel_callback will be null.
  • The gesture_id is the gesture that has been triggered.
  • Setting the reset_gesture to be true will result in the gesture being reset after the callback is triggered, and setting it to false will allow the gesture to not be reset. (No default value is promised.)
  • The value returned, if not ACCEL_SUCCESS will cause the calling method to abort and return the same value. It is cautioned that ACCEL_* values are reserved to be in the range of [0, ACCEL_MIN_RESERVED]. Custom error messages should be outside this scope to be differentiable from accel errors.

No way of resetting affinities.

It should be simple implementation:

  • Extract lines 295-300 from accel_end_record_gesture in accel.c to a method
  • Write tests.

The method signature should be as follows:

int accel_reset_affinities_for_gesture(accel_state *state, int gesture_id);
  • Returns standard success/failure values in the accel.c stuff.
  • First argument must not be NULL.
  • Second argument must be a valid index of a recorded gesture.

Sample application code requires accel_consts.c before building successfully

QUESTION:
I zipped the files located at https://github.com/shalecraig/accel/tree/master/sample/simple-accelerometer and imported the zip on CloudPebble.
Upon building I get an error though...
It seems the file accel_consts.c is missing from your project.
Is it possible to add it please?

In file included from ../src/accel.c:25:0:
../src/accel.h:6:26: fatal error: accel_consts.c: No such file or directory
compilation terminated.

RESPONSE / SOLUTION (I can confirm that this fixes the issue!):
If you look at the commit where I deleted them[0], we I deleted
accel_headers.c, since it wasn't used anymore, and forgot to update
the example.

Try overwriting the source files in[1] with the ones in the root of
the project[2].

[0] 0936368
[1] https://github.com/shalecraig/accel/tree/master/sample/simple-accelerometer/src
[2] https://github.com/shalecraig/accel/tree/master/src

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.