The main formula I use to simulate a shooting to basket like the one of James Harden was a biased random (which contribute to a 40% in 3-points field goal percentage). And for the streaks I use two offsets, that I have called "less" and "more" that varie favoring more than one hit or fail in a row.
if (random(threePercent - less, 100 + threePercent + more) >= 100) {...}
Shooting StreaksWith this in mind we can see on the Serial plotter streaks of even 12 hits of 3-points shots in a row and a maximun of 16 fails in a row on the tests done.
The button is used whith the Arduino intruction: attachInterrupt(digitalPinToInterrupt(BUTTON), changeState, RISING);
Lights represent 3-points scored. If you press the button you shoot to basket.
You can use the code of the project also without mounting the electronic circuit, with the specific code provided for that. Recommendation: use the Serial Monitor in this case.
Test with Serial Monitor and no buttonthere are all the statistic of the basketball player provided by the Serial Monitor
Comments
Please log in or sign up to comment.