Wednesday, March 27, 2019

Jordan Fronko-PM-Open Lab- Jeopardy Code

# Jeopardy Controller
# 3.3v = 1,17, 5.0v =2,4 GND = 6,9,14,20,25,30,34,39
# I/O = 3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,
# More I/O =26,27,28,29,31,32,33,35,36,37,38,40

import RPi.GPIO as GPIO
from time import sleep
import random
import time
n=10
count=0

GPIO.setmode(GPIO.BOARD)
alexResetButton = 18
alexStartTimerButton = 22
readyLED = 5
player1LED = 7
player2LED = 8
player3LED = 10
player4LED = 11
player1Button = 12
player2Button = 13
player3Button = 15
player4Button = 16

GPIO.setup(readyLED, GPIO.OUT)
GPIO.setup(player1LED, GPIO.OUT)
GPIO.setup(player2LED, GPIO.OUT)
GPIO.setup(player3LED, GPIO.OUT)
GPIO.setup(player4LED, GPIO.OUT)
GPIO.setup(alexResetButton, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(alexStartTimerButton, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player1Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player2Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player3Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player4Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
list.Answerbucket[]
Answerbucket.append["He loves to build walls, but hasn't built one yet."]
Answerbucket.append["He is America's Uncle whom makes the most money off you."]
Answerbucket.append["She was born on January 7, 2092","Give me a break of that."]
list.players()
# Your Code Here
def countdown(n) :
if count==0:
players.append[p1]
players.append[p2]
players.append[p3]
players.append[p4]
 print("Jeopardy the game[game reset]")
  if GPIO.output(22,True)
    print("Answer time!",(random.choice(Answerbucket)))
    for count in time:#what is this for? #the timer? I think
      count=count+1
      countup(1)
      print (count, "second(s) left")
#this loop will turn off all of the buttons and turn on the LED for the button that was pressed
      for b in "p1":
        players.remove[p2]
        players.remove[p3]
        players.remove[p4]
        GPIO.output(7,True)
        print("player 1, what is the question to",Answerbucket,"? You have 10 seconds.")
        sleep(.13)
        print("3....")
        sleep(1)
        print("2....")
        sleep(1)
        print('1!')
        while n>0:
          n=n-1
          GPIO.output(7,True)
          countdown(1)
          print (n, "second(s) left")
          GPIO.output(7,False)
          if GPIO.output(12,True):
            break
            if n==0:
              print("Time's up!")
              delay(.1)
              print("let's go again")
              break
while True:
while resetButtonState == False:
  resetButtonState = GPIO.input(alexResetButton)
  if alexResetButton = True:
    GPIO.output(player1LED,False)
    GPIO.output(player2LED,False)
    GPIO.output(player1LED,False)
    GPIO.output(player1LED,False)
    player1Button = False
    player2Button = False
    player3Button = False
    player4Button = False
    n=10
    count=0

today during open lab I worked on the Jeopardy project code. I plan on fine-tuning the player section of code so i can copy-paste them to the rest of the player code. Tomorrow i want to work on the end and beginning as well.

Nicholas-PM- 40 min- Doing robot club

Today in robot club I fixed the wires connected to the sensors.

site:
https://steamclown-robotclub-tank-2.blogspot.com/

Jose Luis Vargas - PM - 60 min - Jeopardy Code

Today I continued working on my Jeopardy code throughout Open Lab Time. I ran into a few problems along the way, but will be continue adding to my code tomorrow.

3d print for car Andrew and Maxx

we looked at various camera mounts for our car. https://www.thingiverse.com/thing:128617
Also maxx found a mound for the pi

Vincent-PM-60-support

I went around to multiple people checking on what they were doing and giving feedback/advice on things they should do or can do.

Erin- PM-1.5hour- Huntington XYZ, Taken Apart

So, yesterday I took off the power supply board on the Huntington XYZ and found 3 CY-40 stepper motor drivers. Mr. Burnham wants us to utilize these when using the motors now.

So, today I did some research on these drivers and found a link. However time had gone up before I could read it through fully.

Picture of Drivers: 

Link to manual: https://manualzz.com/doc/7160573/cy-41--cy-42-bipolar-full-half-step-motor-driver

Adam-PM-40

Today in open lab I worked more on the Jeopardy code:


#Adam and Alex
# Jeopardy Controller
# 3.3v = 1,17, 5.0v =2,4 GND = 6,9,14,20,25,30,34,39
# I/O = 3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,
# More I/O =26,27,28,29,31,32,33,35,36,37,38,40

import RPi.GPIO as GPIO
from time import sleep

GPIO.setmode(GPIO.BOARD)
ResetButton = 18
SecondRoundButton = 22
readyLED = 5
player1LED = 7
player2LED = 8
player3LED = 10
player4LED = 11
player1Button = 12
player2Button = 13
player3Button = 15
player4Button = 16


GPIO.setup(readyLED, GPIO.OUT)
GPIO.setup(player1LED, GPIO.OUT)
GPIO.setup(player2LED, GPIO.OUT)
GPIO.setup(player3LED, GPIO.OUT)
GPIO.setup(player4LED, GPIO.OUT)
GPIO.setup(ResetButton, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(StartTimerButton, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player1Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player2Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player3Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(player4Button, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

# Your Code Here
from time import sleep
import threading

player1Button.state(["!disabled"])  # Enable the button.
player2Button.state(["!disabled"])  # Enable the button.
player3Button.state(["!disabled"])  # Enable the button.
player4Button.state(["!disabled"])  # Enable the button.

t = threading.Timer(45.0) #timer for 45 seconds
t2 = threading.Timer(20.0) #timer

While ResetButton = True:
    readyLED = High
    t.start()#main timer

    If player1Button = True:
        t2.start()#mini timer
        player1LED = High
        time.sleep(.5)
        player1LED = Low
        time.sleep(.5)
        player1LED = High
        player1Button.state(["disabled"])   # Disable the button.
        #if player is wrong, send the other 3 players to redemtion round.
-----------------------------------------------------------------------------------------------------------------------------------------------------
        While SecondRoundButton = True
        
  If player2Button = True:
   t2.start()#mini timer
   player2LED = High
   time.sleep(.5)
   player2LED = Low
   time.sleep(.5)
   player2LED = High
   player2Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player2LED = Low

  If player3Button = True:
   t2.start()#mini timer
   player3LED = High
   time.sleep(.5)
   player3LED = Low
   time.sleep(.5)
   player3LED = High
   player3Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player3LED = Low

  If player4Button = True:
   t2.start()#mini timer
   player4LED = High
   time.sleep(.5)
   player4LED = Low
   time.sleep(.5)
   player4LED = High
   player4Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player4LED = Low
-----------------------------------------------------------------------------------------------------------------------------------------------------

    Else:
        player1LED = Low

    If player2Button = True:
        t2.start()#mini timer
        player2LED = High
        time.sleep(.5)
        player2LED = Low
        time.sleep(.5)
        player2LED = High
        player2Button.state(["disabled"])   # Disable the button.
        #if player is wrong, send the other 3 players to redemtion round.
-----------------------------------------------------------------------------------------------------------------------------------------------------
        While SecondRoundButton = True
        
  If player1Button = True:
   t2.start()#mini timer
   player1LED = High
   time.sleep(.5)
   player1LED = Low
   time.sleep(.5)
   player1LED = High
   player1Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player1LED = Low

  If player3Button = True:
   t2.start()#mini timer
   player3LED = High
   time.sleep(.5)
   player3LED = Low
   time.sleep(.5)
   player3LED = High
   player3Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player3LED = Low

  If player4Button = True:
   t2.start()#mini timer
   player4LED = High
   time.sleep(.5)
   player4LED = Low
   time.sleep(.5)
   player4LED = High
   player4Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player4LED = Low
-----------------------------------------------------------------------------------------------------------------------------------------------------
    Else:
        player2LED = Low

    If player3Button = True:
        t2.start()#mini timer
        player3LED = High
        time.sleep(.5)
        player3LED = Low
        time.sleep(.5)
        player3LED = High
        player3Button.state(["disabled"])   # Disable the button.
        #if player is wrong, send the other 3 players to redemtion round.
-----------------------------------------------------------------------------------------------------------------------------------------------------
        While SecondRoundButton = True
        
  If player1Button = True:
   t2.start()#mini timer
   player1LED = High
   time.sleep(.5)
   player1LED = Low
   time.sleep(.5)
   player1LED = High
   player1Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player1LED = Low

  If player2Button = True:
   t2.start()#mini timer
   player2LED = High
   time.sleep(.5)
   player2LED = Low
   time.sleep(.5)
   player2LED = High
   player2Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player2LED = Low

  If player4Button = True:
   t2.start()#mini timer
   player4LED = High
   time.sleep(.5)
   player4LED = Low
   time.sleep(.5)
   player4LED = High
   player4Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player4LED = Low
-----------------------------------------------------------------------------------------------------------------------------------------------------
    Else:
        player3LED = Low

    If player4Button = True:
        t2.start()#mini timer
        player4LED = High
        time.sleep(.5)
        player4LED = Low
        time.sleep(.5)
        player4LED = High
        player4Button.state(["disabled"])   # Disable the button.
        #if player is wrong, send the other 3 players to redemtion round.
-----------------------------------------------------------------------------------------------------------------------------------------------------
        While SecondRoundButton = True
        
  If player1Button = True:
   t2.start()#mini timer
   player1LED = High
   time.sleep(.5)
   player1LED = Low
   time.sleep(.5)
   player1LED = High
   player1Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player1LED = Low

  If player2Button = True:
   t2.start()#mini timer
   player2LED = High
   time.sleep(.5)
   player2LED = Low
   time.sleep(.5)
   player2LED = High
   player2Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player2LED = Low

  If player3Button = True:
   t2.start()#mini timer
   player3LED = High
   time.sleep(.5)
   player3LED = Low
   time.sleep(.5)
   player3LED = High
   player3Button.state(["disabled"])   # Disable the button.
   #if player is wrong, send the other 3 players to redemtion round.
  Else:
   player3LED = Low
-----------------------------------------------------------------------------------------------------------------------------------------------------
    Else:
        player4LED = Low