DreamForce 2013 Mini-Hack Challenge Project

Dependencies:   ADXL345 USBDevice filter mbed

Fork of df-minihack-slingshot by Doug Anson

Committer:
ansond
Date:
Tue Nov 19 01:21:46 2013 +0000
Revision:
9:3af90289b117
Parent:
7:991749350315
updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 5:2ee478a71b6b 1 Instructions:
ansond 5:2ee478a71b6b 2
ansond 7:991749350315 3 VERY IMPORTANT NOTE:
ansond 7:991749350315 4
ansond 7:991749350315 5 Please be VERY CAREFUL with the slingshot "bands" - they are easily subject to breaking.
ansond 7:991749350315 6 There is a tunable in the source code called "mouse_scale" that can be used to scale
ansond 7:991749350315 7 the band resistance variation to more easily enable a full "deflection" of the slingshot
ansond 7:991749350315 8 in the game. The band itself will "feel" that it is pretty much fully stretched - please
ansond 7:991749350315 9 DO NOT over stretch the band beyond this limit! Thanks and have fun!!
ansond 7:991749350315 10
ansond 5:2ee478a71b6b 11 1). Complete the “hands-on” exercises first
ansond 5:2ee478a71b6b 12 - Required to get setup with an mbed account and the compiler environment
ansond 5:2ee478a71b6b 13
ansond 5:2ee478a71b6b 14 2). Import the “df-2013-minihack-slingshot” project into your mbed project workspace
ansond 5:2ee478a71b6b 15 - Be sure to add and make current the “mbed LPC11U24” board as the current board
ansond 5:2ee478a71b6b 16 to compile to.
ansond 5:2ee478a71b6b 17
ansond 5:2ee478a71b6b 18 3). Examine main.cpp in your project
ansond 5:2ee478a71b6b 19 - In the top of the file, examine the “Mini-hack challenge” statement
ansond 5:2ee478a71b6b 20 - You will need to update potentiometer_value_to_degrees() per the instructions.
ansond 5:2ee478a71b6b 21 The function starts at or about line 129.
ansond 5:2ee478a71b6b 22
ansond 5:2ee478a71b6b 23 A successful implementation will:
ansond 5:2ee478a71b6b 24 - Calculate a reasonable approximation of the sling angle to the sling body
ansond 5:2ee478a71b6b 25 - Utilize the sling angle to the overall angle that is used for the firing trajectory.
ansond 5:2ee478a71b6b 26
ansond 5:2ee478a71b6b 27 Additional Details/Hints:
ansond 5:2ee478a71b6b 28 - If slingshot band is exactly 90° ( = 0°) to the slingshot body then the original
ansond 5:2ee478a71b6b 29 slingshot mouse location method may be used
ansond 5:2ee478a71b6b 30
ansond 5:2ee478a71b6b 31 - If the slingshot band is not 90° to the slingshot body, then further refinement of the
ansond 5:2ee478a71b6b 32 mouse position should be made through calculating the relative angle between the
ansond 5:2ee478a71b6b 33 slingshot body and the slingshot band using the potentiometer
ansond 5:2ee478a71b6b 34
ansond 5:2ee478a71b6b 35 - The relative angle is estimated by mapping ranges of values of the potentiometer to a
ansond 5:2ee478a71b6b 36 degree range. A median potentiometer value denotes that the sling band is 90 degrees
ansond 5:2ee478a71b6b 37 to the sling body.
ansond 5:2ee478a71b6b 38
ansond 5:2ee478a71b6b 39 References:
ansond 5:2ee478a71b6b 40 - Original MBED slingshot cookbook: http://mbed.org/cookbook/Slingshot
ansond 5:2ee478a71b6b 41 - Project Source: http://mbed.org/teams/MBED_DEMOS/code/df-2013-minihack-slingshot/
ansond 5:2ee478a71b6b 42 - Completed Code: http://mbed.org/teams/MBED_DEMOS/code/df-2013-minihack-slingshot-complete/