Got Solenoids in the mail, and successfully integrated one with the TicTacToe program with simple isolation. New pics and othe stuff after break.
Finished up on the code for running the motors. Had a lot of functions, and functions within functions; one for the multiplexer, one for moving the stepper motor that uses the multiplexer function, and lastly a function to update the board based on the moves. It would turn a certain steps form it's default state to display the board.
We will also need a way to reset the board; I set it to turn clockwise for a full revolution, to tun until it hit something so all motors were in the same state after each game. This would require another element in our cam system.
This past weekend, I have unfortunately caught some illness from my sister, hopefully it is just a cold. Anyways, she feels to be feeling better than I am; the worst that could happen if I can't make it to class tomorrow, is I'll try to get her to bring my stuff with a note or something with things Xavier may need, and to possibly communicate online. Much of what I was working on was the code anyway.
A lot of stuff happened since last post. . .
Starting with today, I went to that electronics place on canal street. Unfortunately, they do not carry solenoids out of all the other stuff the have. I inquired about the relays that uses solenoides, but they were not much cheaper than the solenoids available online.
During the two times in class, we found and desoldered 5 stepper motors from old computers. We discovered that they have 21 steps per revolution, which was enough for the 9 possible states for each motor controlling 2 displays. To maximize the use of the revolutions, I also decided to use two steps for each state; a total of 18 out of the 21. I made cams for these motors in SketchUp, now with soother transitions between each state. Xavier plans make them out of wood using the sketches.
In the Arduino code, I modified the player function to be more intuitive. Instead of clicking the joystick then tilting to make a move, I made to make a move when the button is pressed and the joystick is tilted simultaneously. Although the joystick can only be clicked in it's default center position, a separate button can be used to make a move.
Currently, I am finishing up on functions that will run the motors for the display using multiplexers to make it possible to have more than 14 outputs for Arduino (24 are needed fo the motors alone)
Since the presentation, I was able to desolder the joystick and soldered wires to use with Arduino. I noticed when i used analogRead the potentiometers of joystick, I received values from 1-1023. I divided each of them into 3 zones, high, medium (default) and low resistance. This results in nine zones, which was perfect for the TicTacToe board. To make a move, the player would click the joystick, then tilt toward the space they would choose within half a second, otherwise, it would pick the middle space. If the space is taken, it would play 2 tones to indicate the space is not empty.
While testing the joystick, I noticed that I did not pick a random seed. The AI would always choose the bottom space (unless the player went there first) in the first game. I added one function to choose a seed based on an input of an unused pin to fix this bug.
Website updates after break
-multiplexers for 12-20 outputs $0.00-3.00
-8 output mux x3: $1.32
-5 stepper motors, preferable identical: $0.00 (from old computers)
-1 discontinued stepper motor $2.00
-Batteries-Transformer; plug into wall
Rough schedule :
December 4-9, 2011
- Present POC
- Decide on tactile board
- Figure out multiplexer- De-solder motors and Joystick
December 11-19, 2011
- Start building the cams
- Work on building the display board
- Implement Stepper Motor to cams
December 19-23, 2011
- Work on building the display board- Implement Stepper Motor to cams
December 26-30, 2011
- Relax- Discuss what we will need to do online
January 2-6, 2012
- Implement stepper motors and cams into the board
- Work on an alternate power supply
January 9-13, 2012
- Have everything running and done
- Work on things that need to be finished
January 16-20, 2012
- We should be finished but continue working on anything that needs to be fixed.
Heres a review for the hidden electronics place:
http://www.nycresistor.com/2009/09/16/269-electronics/There isn't much information about this place besides this review and what can be inferred from the images. Now that we have a working and smart AI, we need to make a similar program for Arduino that was independent from a computer, and a display for one square for our proof of concept. Since much of the language in Processing is similar for Arduino, I was able to use the same program after deleting the functions (like the draw functions) that could not work in Arduino.
I decided to use a potentiometer to replace the mouse until we have a better way to play. Someone was willing to give a joystick from a old game controller in class (I forgot who it was, comment so I know who to give credit to). Since it uses two potentiometers and a button, we can use it to select a space directly, rather than having to translate numbers to spaces.
For the proof of concept, the idea of cams seems like it would work, although I have some doubts due to its complexity. After building it in Google SketchUp, I feel that solenoids are unambiguously more stable. My dad knows this hidden electronics store in Chinatown somewhere and he is willing to check there for something appropriate.
Here's where I put stuff about my life and what I'm doing!