Husband to an amazing wife and two adorable children. This website covers electrical engineering projects. I have Arduinos and a Raspberry Pi. The EE Lab has everything that I had available at university. This lab has grown and changed over 20+ years. You will learn C# (Arduino) and Python (Raspberry Pi). It covers circuit design. I have 30+ sensors that can be integrated.
Menu
pi_pb_led
This project configured a push button that turns on the LED when you push it.
# basic_i2c_configuration
import RPi.GPIO as GPIO import time from smbus import SMBus
GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.cleanup() bus = SMBus(1) # indicates /dev/ic2-1
button1=23 LED1=24 GPIO.setup(button1,GPIO.IN,pull_up_down=GPIO.PUD_UP) # Make button1 an input, Activate Pull UP Resistor GPIO.setup(LED1,GPIO.OUT,) # Make LED 1 an Output button_state = 1 GPIO.output(LED1,False) while True: button_state = GPIO.input(button1) if button_state == 0: GPIO.output(LED1,GPIO.HIGH) else: GPIO.output(LED1,GPIO.LOW) time.sleep(1)