Created
September 19, 2018 16:54
-
-
Save jeffkaufman/8c25a06ab1b595bb0309b7215fd2a5d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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