Hardware Reference
In-Depth Information
2. Since the DC motor is interfaced to your Raspberry Pi's GPIO #18, it can be turned
on (we are making use of the RPi.GPIO libraries; refer to previous projects if you
are not familiar with RPi.GPIO ):
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18,GPIO.OUT)
GPIO.output(25,GPIO.HIGH)
3.
When a visitor at the exhibiion would like to know how a windmill works, an
instrucional audio recording (the download available with this project merely
plays a test MP3 ile) can be played at the press of a buton as follows:
def my_callback(channel):
os.system('mpg321 recording.mp3 &')
GPIO.add_event_detect(25, GPIO.FALLING,callback=my_callback)
4. The following image shows a windmill generator kit interfaced to a Raspberry Pi:
A windmill generator kit
 
Search WWH ::




Custom Search