Wednesday, March 27, 2019

james-pm-worked on jeopardy some more

I was finally able to make a full structured code on my own as my partner had to leave class.
today I
1. did my random job of putting away tools
2. worked on and finished first draft of code
This code was able to process have a structure that warranted a possible use with LEDS and input buttons.
Tomorrow I will test it with Mr. Burnham and attempt to troubleshoot any issues with the interactions with the input and output electronics.

Demitrius -AM - 60mins - Worked on 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

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)

# Your Code Here
while True:
    input_state = GPIO.input(player1Led)
    if input_state == False:
        time.sleep(0.3)
    input_state = GPIO.input(player2Led)
    if input_state == False:
        time.sleep(0.3)
    input_state = GPIO.input(player3Led)
    if input_state == False:
        time.sleep(0.3)
    input_state = GPIO.input(player4Led)
    if input_state == False:
        time.sleep(0.3)
We continued to work on our code for the controller

# 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
startButton = 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)

# Your Code Here
while True:
    input_state = GPIO.input(startButton)
        if input_state == True:
     print(“start button pressed”)
     for i in range(5):
#player1 led
                GPIO.output(player1LED, True)
                sleep(.25)
                GPIO.output(player1LED, False)
                sleep (.25)
#player 2
                GPIO.output(player2LED, True)
                sleep(.25)
                GPIO.output(player2LED, False)
                sleep (.25)
#player 3
                GPIO.output(player3LED, True)
                sleep(.25)
                GPIO.output(player3LED, False)
                sleep (.25)
#player 4
                GPIO.output(player4LED, True)
                sleep(.25)
                GPIO.output(player4LED, False)
                sleep (.25)
# game
#player 1
                    while True:
                        input_state = GPIO.input(player1Button)
                            if input_state == True:
                                print(“player 1 button pressed”)
                                GPIO.input(player2Button, GPIO.LOW)
                                GPIO.input(player3Button, GPIO.LOW)
                                GPIO.input(player4Button, GPIO.LOW)

#player 2
                    while True:
                        input_state = GPIO.input(player12Button)
                            if input_state == True:
                                print(“player 2 button pressed”)
                                GPIO.input(player1Button, GPIO.LOW)
                                GPIO.input(player3Button, GPIO.LOW)
                                GPIO.input(player4Button, GPIO.LOW)
#player 3
                while True:
                        input_state = GPIO.input(player3Button)
                            if input_state == True:
                                print(“player 3 button pressed”)
                                GPIO.input(player2Button, GPIO.LOW)
                                GPIO.input(player1Button, GPIO.LOW)
                                GPIO.input(player4Button, GPIO.LOW)
#player 4
            while True:
                        input_state = GPIO.input(player4Button)
                            if input_state == True:
                                print(“player 4 button pressed”)
                                GPIO.input(player2Button, GPIO.LOW)
                                GPIO.input(player3Button, GPIO.LOW)
                                GPIO.input(player1Button, GPIO.LOW)


GPIO.cleanup()

Conor-AM-Jeopardy Code

Project: Jeopardy code

Team: Conor, Lindsey

What we did: We started coding the project and I made the  Jeopardy song in Sonic Pi. So far we have the basis of our code and most of the ready button done.

Future plans: In the future we plan to finish the ready button, do the reset button, and be able to lock other LEDs and buttons.

Lindsey - AM - 60 mins - Worked on Jeopardy Code!

Today I was determined to get my Jeopardy code to work, so I did it during open lab. It was hard because there was no hardware for us to test it with, so we had to use debugging code such as putting print functions in places to see if our code was actually working. We turned the code into google classroom despite the code not fully working. We got the "ready button" to work, but we did not know how else to test the timer.

Amy-AM-60min-Working on the Jeopardy code

I continued to work on the jeopardy code. I focused on getting the Jeopardy theme song to play and getting one players button to flash an led. I got the jeopardy song to play when I run it in the terminal, however I have not gotten it to run in the code. I already set the sound to the headphone jack, so there is probably some issues with where the mp3 file is in the directories. I will either try to get the program to change directories to where the mp3 file is or I will move the mp3 file into the home directory.

Next time:

  • Work on combining all four button pushes- one will flash an led, the others will be disabled
  • Get the theme song to play in the code
  • Organizing the main code file

Here is a link where I found Jeopardy theme mp3 song

open lab/Samuel Canales

I worked on a Jeopardy flow chart flow chart

# 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)
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)

# Your Code Here
while True:
    input_state = GPIO.input(player1Led)
    if input_state == False:
        time.sleep(0.3)
    input_state = GPIO.input(player2Led)
    if input_state == False:
        time.sleep(0.3)
    input_state = GPIO.input(player3Led)
    if input_state == False:
        time.sleep(0.3)
    input_state = GPIO.input(player4Led)
    if input_state == False:
        time.sleep(0.3)