Digigurdy-baz
|
Variables | |
const int | SPIN_SAMPLES = 700 |
The number of voltage samples per update. More... | |
const int | VOL_THRESHOLD = 5 |
The lower voltage threshold for the crank to register motion. More... | |
const int | MAX_SPIN = 7600 |
The maximum "spin" value. More... | |
const int | SPIN_WEIGHT = 2500 |
The amount of spin to add when motion is detected. More... | |
const int | SPIN_DECAY = 200 |
The amount of spin to subtract when motion is not detected. More... | |
const int | SPIN_THRESHOLD = 5001 |
The amount of spin necessary to make sound. More... | |
const int | SPIN_STOP_THRESHOLD = 1000 |
The amount of spin below which sound stops. More... | |
const int | BUZZ_SMOOTHING = 250 |
The amount of buzz "smoothing" to start with when buzzing registers. More... | |
const int | BUZZ_DECAY = 1 |
The amount of buzz "smoothing" to subtract when buzzing is not registering. More... | |
These are configuration variables that only apply to gear-motor-crank models.
USE_GEAR_CRANK must be enabled for these to have effect.
const int BUZZ_DECAY = 1 |
The amount of buzz "smoothing" to subtract when buzzing is not registering.
Buzz smoothing is subtracted by this amount every cycle that buzz does not register.
const int BUZZ_SMOOTHING = 250 |
The amount of buzz "smoothing" to start with when buzzing registers.
Buzz is set to this value when buzzing registers and decays.
const int MAX_SPIN = 7600 |
The maximum "spin" value.
Gear crank behavior uses a "spin" number to determine motion, which is added to when cranking is detected, and subtracted from when cranking stops. This is the maximum spin value the counter will allow.
const int SPIN_DECAY = 200 |
The amount of spin to subtract when motion is not detected.
Every cycle that cranking is not detected, this amount is subtracted from the spin value, down to zero.
const int SPIN_SAMPLES = 700 |
The number of voltage samples per update.
This is used to slow down how fast the code runs and avoid timing issues. Choose based on your Teensy unit:
const int SPIN_STOP_THRESHOLD = 1000 |
The amount of spin below which sound stops.
Sound will stop when spin is below this value.
const int SPIN_THRESHOLD = 5001 |
The amount of spin necessary to make sound.
Ultimately, sound will be produced when spin is above this value.
const int SPIN_WEIGHT = 2500 |
The amount of spin to add when motion is detected.
Every cycle that cranking is detected, this amount is added to the spin value, up to the MAX_SPIN.
const int VOL_THRESHOLD = 5 |
The lower voltage threshold for the crank to register motion.