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.
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
After coming back to from Seattle I wanted to do nothing more than work on my care, but Stanley didn’t want to. While I was gone we had the shop teacher, Mr. Bowen, create a steering lever for the car. The lever is a mechanism with a turning arm that rotates in order to turn Stanley left and right. By using the linear actuator the arm could be pushed and pulled to steer. Continue reading Little Stanley Jr.
The Arduino programmed self-driving car is finally capable of driving around in a figure 8! The car can only preform a figure 8 and is capable of avoiding collisions into anything in its path. I also programmed it to reverse and turn when something has stopped it, to overcome the obstacle and to continue the figure 8 command.
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.
Coming back from vacation it does seem like my car hates me a little bit for leaving. Honestly, the word “steering” had never been so threatening until this week. Continue reading Long Week
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
So far, I have successfully managed to have it run on its own. However, it is too heavy to run. I tried a different code hoping to make it work but, it did nothing when I uploaded it. I guess its back to the drawing board.
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
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.