Data Sheet

UCTRONICS Ultimate Starter Leaning Kit for Raspberry Pi #K0064
64 www.uctronics.com
The event_detected( ) function is designed to be used in a loop with other things, but unlike
polling it is not going to miss the change in state of an input while the CPU is busy working
on other things. This could be useful when using something like Pygame or PyQt where
there is a main loop listening and responding to GUI events in a timely basis.
8.4.4 Procedures
1. Build the circuit
2. Program
Python user:
2.1 Edit and save the code with vim or nano.
(https://github.com/UCTRONICS/Arducam_Starter_Kit_Python_Code_for_RPi.git)
2.2 Run the program
$ sudo python 04_btnAndLed_1.py
Now, when you press the button, you can see the state of the LED will be toggled.
(ON->OFF, OFF->ON).