Skip to content

Instantly share code, notes, and snippets.

@jeffkaufman
Created September 19, 2018 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffkaufman/8c25a06ab1b595bb0309b7215fd2a5d6 to your computer and use it in GitHub Desktop.
Save jeffkaufman/8c25a06ab1b595bb0309b7215fd2a5d6 to your computer and use it in GitHub Desktop.
#import "yocto_api.h"
#import "yocto_tilt.h"
void yocto_callback(YTilt* tilt, NSString* functionValue) {
NSLog(@"Tilt: %@", functionValue);
}
void setup() {
NSError* error_ignored;
[YAPI RegisterHub:@"usb": &error_ignored];
[[YTilt FirstTilt] registerValueCallback:yocto_callback];
}
int main(int argc, char** argv) {
setup();
while (true) {
[YAPI Sleep:250:NULL];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment