###### 2020 - 2021 HKUST RT Defense Dragon
# TR User Manual
##### (Last update: 05:35am, 16/5/2021)
### I am so tired so this manual is quite brief. Please forgive me.
[TOC]
## A Quick Review of the Garuda:

## Buttons Configurations and Functions with Ports
#### Ports
* nRF Port: Connect to a nRF modules to have wireless control of the WB. (Instead we are using Bluetooth currently.)
* SWD Port: For code flashing to the Garuda. Most of the time we just have to flash once before used.
* UART Port: Connect a Can wire (since the T and R port here is flipped) to the WB to control the WB, or connect to a Bluetooth modules to control the WB. (We are currenly using Bluetooth.)
* Toggle: A switch. (HW has not yet soldier this on to our Garuda. Actually I am planning to use this to switch between Manual mode and Auto mode.)
#### Buttons
* **Rst_MB**: I don't know what is the use of this button Lol. (From what I have read from the code, this should be the reset button for the toggle. But I am not sure how its works exactly.)
* **RST**: The reset button for the Garuda.
* **TopLeft**: Press to turn the TFT on the mainboard to the previous page.
* **TopRight**: Press to turn the TFT on the mainboard to the next page.
* **Up**: Click to jump to the next state of the whole sequence. The whole sequence would be:
1. Move the WB from the corner to the Start Zone which the WB will not be counted as violation. The magazine will be lifted. Arrows with ID.1 and ID 3 will be loaded by the two shooters.
2. Move the WB from the Start Zone to Point A which is the first shooting point.
3. Move the WB from Point A to Point C which is in front of the rack to load arrows.
4. Move the WB from Point C to Point D which is the second shooting point.
5. Move the WB from Point D to Point C to load arrows again.
6. (Move the WB from Point C to Point D but not yet written to the code.)
* **Left**: Click to jump to the next sub-state for each shooting point (Point A and Point D).
Sub state for Point A:
1. The Left shooter will load arrows and shoot arrows to the "東" pot.
2. The Right shooter wll load arrows and shoot arrows to the "中" pot.
3. The Left shooter will load arrows and shoot arrows to the "東" pot.
Sub state for Point D:
1. The Right shooter will load arrows and shoot arrows to the "北" pot.
2. The Left shooter will load arrows and shoot arrows to the "南" pot.
3. The Right shooter will load arrows and shoot arrows to the "北" pot.
4. The Left shooter will load arrows and shoot arrows to the "南" pot.
5. The Left shooter will load arrows and shoot arrows to the "西" pot.
* **Right**: Click to jump to the previous sub-state for each shooting point (Point A and Point D).
* **Misc1**: Switch between Auto mode and Manual mode. If you pressed "UP" but you see the WB gone crazy, immediately press this button to stop the WB. This button acts as a wireless E-stop for Auto mode.
* **Misc2**: Switch between the two shooter. In case you want to be a Human-machine-learn, otherwise you do not have to use this button. Just use "Left" and "Right" to switch between sub-states is ok.
* **Misc3**: Apply laser reading to the lasers. Unused for now.
* **Misc4**: Reset the laser reading for the shooters. Unused for now.
* **Misc5**: Set the current position of the WB to the corner(Beginning position)
* **Misc6**: Auto load arrows from the rack. Unused for now.
* **Misc8**: Press once to load arrows from magazine. Press once more to shoot.
* **Zone A**: Subtracting acceleration for shooters. In case you want to be a Human-machine-learn, otherwise you do not have to use this button.
* **Zone B**: Adding acceleration for shooters. In case you want to be a Human-machine-learn, otherwise you do not have to use this button.
* **Zone C**: Subtracting velocity for shooters. In case you want to be a Human-machine-learn, otherwise you do not have to use this button.
* **Zone D**: Adding velocity for shooters. In case you want to be a Human-machine-learn, otherwise you do not have to use this button.
* **Left Joysitck(turning)**: Move the WB. (Forward, backward, left and right)
* **Right Joysitck(turning)**: Turn the WB. (Clockwise and anti-clockwise)
* **Right Joysitck(pressing)**: Untwist the WB. Press this after the WB has travelled a certain distance. Also press this before turning off the WB.
* **I/O_1**: Auto loading and shooting for shooters. Unused for now.
* **I/O_2**: Move the magazine to the leftmost.
* **I/O_3**: Move the magazine to the middle.
* **I/O_4**: Move the magazine to the rightmost
* **I/O_6**: Toggle a GPIO pin. Do not press this.
* **I/O_7**: Toggle a GPIO pin. Do not press this.
* **I/O_8**: Toggle a GPIO pin. Do not press this.