shalecraig / accel Goto Github PK
View Code? Open in Web Editor NEWAccel is a simple library written in C that uses accelerometer data to find gestures in realtime.
License: MIT License
Accel is a simple library written in C that uses accelerometer data to find gestures in realtime.
License: MIT License
Decide between:
Requirements:
accel_find_most_likely_gesture
can be called at almost any time.accel_callback_found
.accel_generate_state
should take an additional nullable parameter of accel_callback_found
.NULL
accel_callback_found
implies the user will call the accel_find_most_likely_gesture
method themselves.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:
accel_callback
will be null.gesture_id
is the gesture that has been triggered.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.)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.It should be simple implementation:
accel_end_record_gesture
in accel.c to a methodThe method signature should be as follows:
int accel_reset_affinities_for_gesture(accel_state *state, int gesture_id);
NULL
.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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.