The New Layout

The robot was previously not very nice to look at, with the Raspberry Pi, motor driver, two power supplies, and countless wires all making a big mess.  Now that the robot is able to play a game of tic tac toe, I have begun working on its final layout.  It will have one power supply that can output two different voltages, and is smaller than the old ones.  In addition, all the components will be stored in a compartment under the clipboard to keep them out of sight.  I will also solder all the wires which were on the breadboard.  I would like to add a few more features to the robot, and once this is done, it would make any future programming much easier than before.

Week 8: Digital Compass

The digital compass is displaying east-south-east which is the same as the analog compass above. This proves that it is in fact accurate as far as magnetic north is concerned

I have created a digital compass. It can tell you 16 different directions and the degrees down to the tenths of a degree.
It took a while to program each of the directions correctly. The reason for this is that if I were to use the character “char” variable type it would only  display one character. This is what it is supposed to do but, it is a problem since I have directions like north-west and north-north-west which are displayed as NW and NNW respectively. So, in order to fix this problem I had to use the string function which produces a string of characters. this is what allows me to display those directions. Continue reading Week 8: Digital Compass

Week 8

The light sensing car that I have worked on for a few weeks now works .Well, actually it worked before but, it now stops when it gets dark enough. before this week it wouldn’t stop. This was mostly due to the function that matches the values of the light sensor to the values the motor needs. If it got dark enough the program would give the motor negative values. This caused it to drive even when it was completely dark and made it impossible to tell if the code was working when I tested it.  The solution was simple. I gave it functions that told it to turn off completely after it was dark enough instead of gently coming to a stop. I also gave it a code to turn on completely when it was bright enough.

The Robot’s New Features

Last week, the robot played its first game.  However, there were still some features that were needed, and others that I simply wanted.  It now draws a line through the winning spaces after it makes a winning move.  In addition, whether it was player 1 or 2 used to be determined by a line of code in the program, and this had to be changed manually between games.  However, now it can decide for itself if it should go first or second by looking at the board at the start of the game. Continue reading The Robot’s New Features

Improving The Motorized RC car with a Motor Driver

In the previous week of robotics my main goal was to add a new and improved motor driver that could handle more voltage. The H-Bridge  couldn’t handle the rapid switching so this swap was very necessary for my project.  The motor driver that installed now is a     ” TB6612″ in case anyone was trying to find a solution to controlling motor speed, direction, and any other sequences of demands that you could create. Continue reading Improving The Motorized RC car with a Motor Driver

The Tic Tac Toe Robot Plays Its First Game

This week, I was finally able to put my work on the camera and arm together, and I played a game against the robot.  It is not yet working perfectly, as it sometimes draws on top of another shape or fails to move the marker down to the paper.  However, it usually performs well, and I expect I will be able to overcome these issues soon.  Below is a video of the arm playing a game perfectly.

Continue reading The Tic Tac Toe Robot Plays Its First Game