|
|||||
6.2. Simple Experiment on Game Port 6.2.1. Detecting Button Position This program shows you how to read the buttons state. The main function is only used to display the buttons state, while pressed or not. In this experiment we used 4 button to simulate joystick, these button connected to pin 2,7,10 and 14 as shown in the picture bellow. Delphi Programming ( Download File exp621.zip ) a.To read the button position, first you should prepare a form with 1 timer, 4 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); 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 pressing the button in the circuit. |
Free Software Lesson 1 Lesson
4
|
||||