17 double v_smooth = 0.0;
27 unsigned int this_time;
28 unsigned int lt_1, lt_2, lt_3, lt_4, lt_5, lt_6, lt_7, lt_8 = 0;
34 bool was_spinning =
false;
35 bool was_buzzing =
false;
48 elapsedMicros the_timer;
49 elapsedMicros the_spoke_timer;
50 elapsedMicros the_stop_timer;
51 elapsedMillis the_buzz_timer;
52 elapsedMillis the_expression_timer;
55 GurdyCrank(
int s_pin,
int buzz_pin,
int led_pin);
Definition: gurdycrank.h:11
void disableLED()
Disables the buzz LED indicator object.
Definition: gurdycrank.cpp:261
bool isDetected()
Reports if a crank is connected.
Definition: gurdycrank.cpp:33
bool stoppedBuzzing()
Reports whether buzzing stopped this update() cycle.
Definition: gurdycrank.cpp:222
bool startedBuzzing()
Reports whether buzzing began this update() cycle.
Definition: gurdycrank.cpp:201
void enableLED()
Enables the buzz LED indicator object.
Definition: gurdycrank.cpp:269
void updateExpression()
Updates the expression value and applies it to the strings.
Definition: gurdycrank.cpp:135
void update()
Samples the crank and updates its state.
Definition: gurdycrank.cpp:40
double getVAvg()
Returns the crank's current (heavily-adjusted) velocity.
Definition: gurdycrank.cpp:241
bool isSpinning()
Reports whether the crank is currently spinning this update() cycle.
Definition: gurdycrank.cpp:195
int getCount()
Returns the number of detected spoke transitions.
Definition: gurdycrank.cpp:248
bool startedSpinning()
Reports whether the crank started spinning this update() cycle.
Definition: gurdycrank.cpp:165
double getRev()
Returns the number of estimated crank revolutions.
Definition: gurdycrank.cpp:255
bool stoppedSpinning()
Reports whether the crank stopped spinning this update() cycle.
Definition: gurdycrank.cpp:180
Definition: simpleled.h:11
const int NUM_SPOKES
The number of "spokes" on the optical crank wheel.
Definition: config.h:113