Raspberry Pi Projects - Manasquan Public Schools

Raspberry Pi Projects - Manasquan Public Schools

Raspberry Pi Projects 1 2 Light Button Buttons Emitting Diodes LED and Buttons Simply Button import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN,pull_up_down=GPIO.PUD_UP) while True: input_state = GPIO.input(17) if input_state == False:

print('Thanks MESEF') time.sleep(0.2) 2 Buttons from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) button1=17 button2=12 GPIO.setup(button1,GPIO.IN,pull_up_down=GPIO.PUD_UP) GPIO.setup(button2,GPIO.IN,pull_up_down=GPIO.PUD_UP) while(1): if GPIO.input(button1)==0:

print("Button 1 was pressed:") sleep(0.1) if GPIO.input(button2)==0: print("Button 2 was pressed:") sleep(0.1) Simple LED from gpiozero import LED from time import sleep led = LED(17) while True: led.on()

sleep(2) led.off() sleep(2) Button and LED from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) button1=17 LED1=21 GPIO.setup(button1,GPIO.IN,pull_up_down=GPIO.PUD_UP) GPIO.setup(LED1,GPIO.OUT) BS1=False

while(1): if GPIO.input(button1)==0: print ("Button 1 was pressed") if BS1==False: GPIO.output(LED1,True) BS1=True sleep(0.5) else: GPIO.output(LED1,False) BS1=False sleep(0.5)

Recently Viewed Presentations

  • Helping policy makers create death with dignity policies

    Helping policy makers create death with dignity policies

    Challenge participants to understand the connection between suffering and good EOL policies. Updated on the current Aid in Dying/Death with Dignity (AID/DWD) movement in the United States. Open Discussion on Aid in Dying in Participants various jurisdictions.
  • Analytics in Higher Education: Methods Overview Scott James

    Analytics in Higher Education: Methods Overview Scott James

    Multilevel Modeling. Structural Equation Modeling (SEM) Example. There are two possible outcomes: If the result confirms the hypothesis, then you've made a measurement. If the result is contrary to the hypothesis, then you've made a discovery. ...
  • Using a Variety of Leads in Narrative Writing

    Using a Variety of Leads in Narrative Writing

    Narrative Writing. Why is a powerful lead so important? A lead is what draws the reader into your story. A good lead hooks readers from the beginning and makes them excited to continue reading. THE LEAD. The lead is the...
  • Integration Introduction  This is a very big chapter

    Integration Introduction This is a very big chapter

    In the trapezium rule we thought of the area under a curve being split into trapezia. To simplify this explanation, we will use rectangles now instead. The height of each rectangle is y at its x-coordinate. The width of each...
  • Journal 30: Tragic Heroes & Classical Tragedy

    Journal 30: Tragic Heroes & Classical Tragedy

    Students will be able to identify what makes a character a tragic hero . Students will be able to identify a character as a tragic hero and identify their Tragic Flaw. Students will be aware of, and able to define,...
  • Instructions  This Document contains 3 slides. Each one

    Instructions This Document contains 3 slides. Each one

    The poster can be created in PowerPoint or Photoshop, but if a different application is needed, please contact [email protected] before creating the poster. We cannot print Keynote posters. The final size of the poster file needs to be fewer than...
  • Alkaloids - Natural nitrogenous secondary metabolites from plants

    Alkaloids - Natural nitrogenous secondary metabolites from plants

    Alkaloids - Natural nitrogenous secondary metabolites from plants and microbes. ... Block b-adrenoreceptors that regulate cardiac muscle contractions (b. 1) ... Natural nitrogenous secondary metabolites from plants
  • Main Title Goes Here - Information Builders

    Main Title Goes Here - Information Builders

    Dynamically Loop Through Database Connections With DataMigrator Presented by Kathy Getz, Omnicare Inc. Lori Pieper, Information Builders Inc. Agenda Presenter Introductions Omnicare Business Overview Omnicare Architecture Challenges/Solution Questions/Answers Omnicare Business Overview Omnicare, Inc. OCR, a Fortune 500 company based in...