button.sh zum Lesen des Tasterzustands.
This commit is contained in:
		
							
								
								
									
										13
									
								
								raspi-bash/button.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								raspi-bash/button.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| #! /usr/bin/bash | ||||
| #File: button.sh | ||||
|  | ||||
| pin_button=23  # Button an BCM23 | ||||
| gpiochip="gpiochip0" | ||||
|  | ||||
| pinctrl set ${pin_button} pu # Pin  | ||||
| while true; do | ||||
|   gpioget ${gpiochip} ${pin_button} | ||||
|   sleep 3 | ||||
| done | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user