Back to Parent

FSR Game

Make a basic game which challenges you to reach the most force.

Set three levels of force: medium (>1000), hard (>1500) and extra hard (>2000).

If the player gets to medium - blink once; hard, twice; and extra hard three times.

Wait until the force sensor reading returns to zero before starting again.


This is a fun exercise as I can play the game after setting up. The tricky part is to use the if statement for different force ranges. I also use the ledBlink function we built in Lab 1 to make the code cleaner and easier to change the variables. Please note that the original analog read range is too narrow for me to differentiate, so I use 1000 interval for FSR readings.


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0