|
|||||
|
6.2.2. Measuring Variable Resistance - Game Port This program shows you how to read the joysticks position. The main function is only used to display the joysticks position. In this experiment we used only simulate 1 joysticks position, these joystick connected to pin 3 as shown in the picture bellow. Delphi Programming ( Download File exp622.zip ) a.To read the button position, first you should prepare a form with 1 timer, 1 edit and labels component, as shown in the picture bellow. In timer1 component in object inspector, set up for the configuration as shown in the picture bellow.
b. Click twice on timer 1, and then insert instruction as shown bellow procedure TForm1.Timer1Timer(Sender: TObject); procedure TForm1.Button1Click(Sender: TObject); begin timer1.enabled:=true; end; c. To run the program, you must hit F9 or RUN from main menu, then you will see a picture as shown bellow. Try to simulate the program by turning righ or left the potensio in the circuit. |
Free Software Lesson 1 Lesson
4
|
||||