@@ -106,7 +106,18 @@ In order to optimize our experimentation with various PID values for the program
### Choice of parameters on the fly
---
#### Making the program
#### Making the programs
To make a GUI that runs on a computer and communicates variable values with the program running on the NTX we retrieved the ***TrackerController.java*** and the ***Tracker.java*** from [lesson 2](TODO ref) which was used respectively for controlling the PID values used on the NTX and receiving and using these values in a PID controller for the ultrasonic sensor. The ***TrackerController.java*** hence became the inspiration for our PC GUI and the ***Tracker.java*** for the NXT program responsible for receiving the sent values.
Later on we noticed that the lesson plan actually gave two java programs to use as inspiration, but at this point we had already written the program ourself and therefore ignored them.
We ended up writing (basically through capy-paste though) four programs; ***PICcontroller.java***, ***PCconnection.java***, ***Sejway.java*** and ***NXTSegwayRunner.java***.
The ***PIDcontroller.java*** is the PC GUI to enable PC control of variables used on the NXT. This program sets up a GUI with six fields and two buttons. The first two fields contains name and bluetooth device ID, which is used when clicking the 'connect'-button, as this action starts NXT communication with the given device ID and sets up a dataOutPutStream [TODO ref].
The ***PCconnection.java*** is inspired from the ***Tracker.java*** and therefore is responsible for retrieving the parameters send from the pc through the datastream.
It basically does three things; sets up a GUI for parameter entering with two buttons, connects to the specfied NXT and establishes a datastream for parameter exchange.
We used the **TrackerController** class [4] from lesson 2 as a basis for our GUI, and ended up using ***PIDController.java*** on the PC and ***PCconnection.java*** + ***Sejway.java***.
When able to control the calibration (Setpoint) variable, we made the robot 'fall' to both sides. This means that we now can be able to control the PID-variables.