Last active
December 27, 2015 22:59
-
-
Save StuffAndyMakes/7403170 to your computer and use it in GitHub Desktop.
Arduino code for FitBit Cheat-O-Matic
This file contains hidden or 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
| #include <Servo.h> | |
| #define SERVO_PIN 9 | |
| #define SPEED_POT 14 | |
| Servo fitBitShaker; | |
| void setup() { | |
| fitBitShaker.attach( SERVO_PIN ); | |
| pinMode( SPEED_POT, INPUT ); | |
| } | |
| void loop() { | |
| int stopTime = 1000 * ( analogRead( SPEED_POT ) / 1023.0 ); | |
| fitBitShaker.write( 130 ); | |
| delay( stopTime ); | |
| fitBitShaker.write( 90 ); | |
| delay( stopTime ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment