User:NathanMinnick58/ENES-100/project 1

Project 1 Arduino based Tic-Tac-Toe  Group Page

Week0 Preferences
Arduino based Tic-Tac-Toe Single Player. See this for a simpler design: Arduino based Tic-Tac-Toe. Here is another design

Design a computer vs human player Tic-Tac-Toe game using Arduino.

How to make the design example

Week1 Narrative
The group has decided that we will build a player to player arduino based Tic Tac Toe game, then if we have time we will design a system that will be computer vs. player. Because we figured that the computer vs. player will require more programming to work.

The group came up with a few design ideas for the Tic Tac Toe game. the first idea was to use nine tri-color LEDs and use a touch screen. The other idea was to use nine LEDS with two switching, one to choose the position the player wants and the another to pick the LED and end the turn. The problem with the touch screen idea is that it will cost more money. The switches are available in the lab and I found different types of push buttons that the group could use of this project.

Materials that are need for this project are:
 * 9 tri-color LEDS
 * Breadboard
 * 9 resistors, 100 ohms
 * 2 or 3 switches
 * wires

Building the circuit, I tried on learning how to lit one LED and faced many problems with the LED I researched more about the breadboard. Circuit was using a battery instead of the power source from Arduino.

Week2 Narrative
During this week our group built a circuit with six LEDs that all lit up when a button is pressed. One button lights all the LEDs a blue color and the another lights the LEDs with a green color to distinguish between players. The problem that we will faced this week was trying to figure out the breadboard and lighting a LED. Jerry was able to figure how to light a LED from researching online. Our group also figure out how to light a external LED using Arduino. Arduino has an example coding for blinking a LED, since the Arduino comes with a built in LED, our group had to figure how to light a LED on a breadboard. We attained a wire to pin 7 on Arduino to the breadboard with a circuit that was wire together with a LED and a resistor. The coding for Arduino was changed to light the LED at pin 7. Right now the breadboard has a lot of wires that we would like the final prototype to have less wires or build a cover to hide the wires. On Thursday our group presentation our project to the engineering seminar Our major problem is developing codes for the tic-tac-toe game. Right now the group agreed on building a human vs. human tic-tac-toe game and if we have time we will design a computer vs. human game.

Some ideas for the computer player program:
 * 1. Decide if there are two places in the row that the computer have, then choice the place to win the game, if not...
 * 2. Decide if there are two places in a row that the other player has, then choice the place to block the other player.If not...
 * 3. Then the computer will choice a place that will benefit them for the next turn. If not...
 * 4.then the computer will choice a place that is not taken.

Week3 Narrative
During this week the group finished the constructed of the circuit by wiring the last three LED's. Our group had a problem with some of the LED's because one LED was too dim to be used and another LED did not lit a green color which is needed to tell the players which turn it is. Right now the group finished testing the switches to light the LED's. The switches keep the LED light after the switch is pressed, the group wants to design the circuit so that when the switch is pressed the LED stays on until the game is reset or until the board is filled. The switches we used in the past week only keep the LED light when the switch is pressed, however when the switch is released the LED turns off.

The next phase of the project is to obtain the codes from one of the group members friends. He knows how to code with Java so he how to change the code to be used with Arduino. The group will test the codes with the circuit. the group might have to update the coding to fix any bugs and problems so that the code will follow the group's criteria of how we what the tic tac toe game to work.

Week4 Narrative
The task I was assigned this week was to research and understand more of Arduino coding to be able to use a push button to keep the LED on.

The main problem that the group had last was been able to find a push button that will keep the LED always on when a button was pressed. The buttons that group were using are push buttons. These buttons only stay on when the button is pushed. I research code for Arduino for push button and i i found that Arduino has an example coding called button this coding provide a basic understand of circuits for pushbbutton to light an LED.Another example coding that Arduino provides is called state change detection. This code was able to determine the different states of the LED from being HIGH or LOW based on the counter number of how many time the button is pressed. If the counting number is 2, and if the LED current state is LOW press the button once to turn on the LED. Another example, if the counting number is 4, and if the LED current state is LOW press the button three time to turn on the LED and when high pressed the button once to turn off. The push button that the example uses, has four legs.Only two legs are need to turn on an LED. The sketch of the push button describes the legs in more detail.