From d9c675fba5dbc6249a0df96d266f17c86cfa95f1 Mon Sep 17 00:00:00 2001 From: Cedric Spindler Date: Thu, 5 Sep 2019 12:47:05 +0200 Subject: Lint-fix markdown syntax - no content/semantic changes! - trim trailing whitespace - fix header levels - # header style - link syntax - list syntax - code / no-format syntax --- ...aspberry_Pi___42____42__Blink__42____42___.mdwn | 125 +++++++++------------ 1 file changed, 56 insertions(+), 69 deletions(-) (limited to 'Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn') diff --git a/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn b/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn index 1b4796a8..8c0b16a9 100644 --- a/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn +++ b/Howtos/_Raspberry_Pi___42____42__Blink__42____42___.mdwn @@ -1,116 +1,103 @@ -#IOT-Webseite +## IOT-Webseite Urs hat auf thingspeak.com einen Account eingerichtet. Dort können kostenlos channels engerichtet werden. Jeder hat die Möglichkeit, Daten auf seinen Account hochzuladen. -##Upload-Code +### Upload-Code Entscheidend für den Upload ist der Key und der entsprechende http-Request. +Während dem Workshop können die Sensordaten hier ausgelesen werden : +## GPIO verwenden -Während dem Workshop können die Sensordaten hier ausgelesen werden : [[http://thingspeak.com/channels/127415]] +### Installation +#### Um neue Software zu suchen + sudo apt-get update + sudo apt-get upgrade -# GPIO vervenden # +#### GPIO Software installieren -## Installation ## + sudo apt-get install python-dev + sudo apt-get install python-rpi.gpio -### Um neue Software zu suchen +#### Adafruit Beispiele installieren -1. sudo apt-get update -2. sudo apt-get upgrade + sudo apt-get install git + git clone http://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git + cd Adafruit-Raspberry-Pi-Python-Code + ls +### Wo ist welcher PIN? -### GPIO Software installieren + -1. sudo apt-get install python-dev -2. sudo apt-get install python-rpi.gpio +### Eine LED verbinden - -### 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 +## LED mit Python-Interpreter steuern -
-import RPi.GPIO as GPIO ## Importiere GPIO Bibliothek
-import time ## Damit man Warten kann
+    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.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.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
-
+ 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
 
+    import RPi.GPIO as GPIO ## Importiere GPIO Bibliothek
+    import time ## Damit man Warten kann
 
-##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()
+    GPIO.setmode(GPIO.BOARD) ## Nutze BOARD PIN-Nummerierung
+    GPIO.setup(7, GPIO.OUT) ## PIN 7 soll ein Ausgang sein
 
-## 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): ")
+    ## 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()
 
-## Start Blink() function. Convert user input from strings to numeric data types and pass to Blink() as parameters
-Blink(int(iterations),float(speed))
-
+ ## 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 + sudo apt-get install build-essential python-dev python-openssl + git clone https://github.com/adafruit/Adafruit_Python_DHT.git + cd Adafruit_Python_DHT/ + sudo python setup.py install + cd examples/ + 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