Wiring buttons and LED - trigger script
Posted: Thu Feb 16, 2017 10:25 am
Hi!
I am attempting to make a Raspberry pi 3 into to a Tiny Backup box that will backup my sd-cards from my camera automatically. I have been following this tutorial: http://www.linux-magazine.com/Issues/20 ... sed-Backup and have gotten all the scripts to work.
But I can't get the buttons or LED:s to work. In his wiring diagram he has wired the buttons and LED to the SDA pin and TXD pin. When I google most seem to wire to 3,3v pin and a GND pin. Is there any specific reason to wire to SDA/TXD pin?

I also found that you can enable SPI and IC2 in raspi-config? Is this something I need to do?
Any tips on how I would wire the buttons and LED otherwise?
This is the script that utilizes the buttons and LED.
I am attempting to make a Raspberry pi 3 into to a Tiny Backup box that will backup my sd-cards from my camera automatically. I have been following this tutorial: http://www.linux-magazine.com/Issues/20 ... sed-Backup and have gotten all the scripts to work.
But I can't get the buttons or LED:s to work. In his wiring diagram he has wired the buttons and LED to the SDA pin and TXD pin. When I google most seem to wire to 3,3v pin and a GND pin. Is there any specific reason to wire to SDA/TXD pin?

I also found that you can enable SPI and IC2 in raspi-config? Is this something I need to do?
Any tips on how I would wire the buttons and LED otherwise?
This is the script that utilizes the buttons and LED.
Code: Select all
01 #!/usr/bin/env python
02 from time import sleep
03 import os
04 import RPi.GPIO as GPIO
05 GPIO.setmode(GPIO.BCM)
06 GPIO.setwarnings(False)
07 GPIO.setup(17, GPIO.IN)
08 GPIO.setup(23, GPIO.IN)
09 GPIO.setup(25, GPIO.OUT)
10 GPIO.output(25, True)
11 while True:
12 if (GPIO.input(17) == False ):
13 os.system('./get-all-files.sh')
14 GPIO.output(25, False)
15 if (GPIO.input(23) == False):
16 os.system('sudo halt')
17 sleep(0.1);