From f52a46ee139f4867cbc23727d7350617c01e548a Mon Sep 17 00:00:00 2001 From: zweistein Date: Sat, 29 Oct 2016 15:25:06 +0200 Subject: rename _Raspberry_Pi___42____42__Blink__42____42___.mdwn to Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn --- ...aspberry_Pi___42____42__Blink__42____42___.mdwn | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn (limited to 'Howtos') diff --git a/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn b/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn new file mode 100644 index 00000000..e9a6b68e --- /dev/null +++ b/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn @@ -0,0 +1,102 @@ +# GPIO vervenden # + +## Installation ## + +### Um neue Software zu suchen + +1. sudo apt-get update +2. sudo apt-get upgrade + + +### GPIO Software installieren + +1. sudo apt-get install python-dev +2. sudo apt-get install python-rpi.gpio + + +### Adafruit Beispiele installieren + +1. sudo apt-get install git +2. git clone http://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git +3. cd Adafruit-Raspberry-Pi-Python-Code +4. ls + +## Wo ist welcher PIN? + +[[ http://pinout.xyz/ ]] + + +##Eine LED verbinden +LED mit Raspberry Pi verbinden +Bild von adafruit.com + +##LED mit Python-Interpreter steuern + +
+import RPi.GPIO as GPIO ## Importiere GPIO Bibliothek
+import time ## Damit man Warten kann
+
+GPIO.setmode(GPIO.BOARD) ## Nutze BOARD PIN-Nummerierung
+GPIO.setup(7, GPIO.OUT) ## PIN 7 soll ein Ausgang sein
+
+GPIO.output(7,True) ## Schalte GPIO pin 7 an
+GPIO.output(7,False) ## Schalte GPIO pin 7 an
+
+GPIO.cleanup() ## Um das ganze sauber zu beenden
+
+ +## Kleines Blink-Programm +
+import RPi.GPIO as GPIO ## Importiere GPIO Bibliothek
+import time ## Damit man Warten kann
+
+GPIO.setmode(GPIO.BOARD) ## Nutze BOARD PIN-Nummerierung
+GPIO.setup(7, GPIO.OUT) ## PIN 7 soll ein Ausgang sein
+
+
+##Define a function named Blink()
+def Blink(numTimes,speed):
+    for i in range(0,numTimes):## Run loop numTimes
+        print "Iteration " + str(i+1)## Print current loop
+        GPIO.output(7,True)## Switch on pin 7
+        time.sleep(speed)## Wait
+        GPIO.output(7,False)## Switch off pin 7
+        time.sleep(speed)## Wait
+    print "Done" ## When loop is complete, print "Done"
+    GPIO.cleanup()
+
+## Ask user for total number of blinks and length of each blink
+iterations = raw_input("Enter total number of times to blink: ")
+speed = raw_input("Enter length of each blink(seconds): ")
+
+## Start Blink() function. Convert user input from strings to numeric data types and pass to Blink() as parameters
+Blink(int(iterations),float(speed))
+
+ + +## Beispiel für Luftfeuchte- und Temperatursensor + + +Bild von adafruit.com + +1. sudo apt-get install build-essential python-dev python-openssl +2. git clone https://github.com/adafruit/Adafruit_Python_DHT.git +3. cd Adafruit_Python_DHT/ +4. sudo python setup.py install +5. cd examples/ +6. sudo ./AdafruitDHT.py 11 4 + +# Raspberry Pi IoT + +Als Beispiel sendet ein Raspberry Pi den Wert eines Potentiometers auf thingspeak.com. + +Die Daten können unter dem folgenden Link angesehen werden. +[[ https://thingspeak.com/channels/127415 ]] + +## Links + +[[ http://www.thirdeyevis.com/pi-page-2.php ]] + +[[ https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/overview ]] + +[[ https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/overview ]] -- cgit v1.2.1