| Electronic Components Datasheet Search |
|
KY-032 Datasheet(PDF) 4 Page - JOY-IT |
|
|
|||||||||||||||||||||||||||||
KY-032 Datasheet(HTML) 4 Page - JOY-IT |
|
4 / 4 page ![]() KY-032 Obstacle-detect module Page of 4 4 Export: 02.03.2021 This document was created with BlueSpice Code example Raspberry Pi # Needed modules will be imported and configured import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # Declaration of the input pin which is connected with the sensor. GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) # Break between the results will be defined here (in seconds) delayTime = 0.5 print "Sensor-Test [press ctrl+c to end]" # main program loop try: while True: if GPIO.input(GPIO_PIN) == True: print "No obstacle" else: print "Obstacle detected" print "---------------------------------------" # Reset + Delay time.sleep(delayTime) # Scavenging work after the end of the program except KeyboardInterrupt: GPIO.cleanup() Connections Raspberry Pi: Enable = - [N.C. (jumper plugged in)] Signal = GPIO24 [Pin 18] +V = 3,3V [Pin 1] GND = GND [Pin 6] Example program download KY-032_Obstacle-detection_RPi To start, enter the command: sudo python KY-032_Obstacle-detection_RPi.py |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |