This is Denzel Alexander webpage. Here you will find information on my scribbler and myself amonng other things. I like to play video games and learn about computers. I like the learning aspect and the programs you can create with the knowledge of computer science. I traveled back and forth from Humboldt County to Los Angeles for the summer. My hobbies include video games and skateboarding.

My robot is named Alfred. Currently it moves slow. The coolest thing about my scribbler is that it can turn on and off successfully without any failures.

Wednesday Action

Picture of my scribbler and others in action during lecture on Wednesday.

Battery Life and Obstacle Command

.get.Battery,battery life


The battery life of the robot was 7.24455 when the command ran. 6400,6400, when the robot is 20 cm fromt he wall. When the robot is 50cm from the wall, the value is 1280,0. When the robot is 60cm away from the wall the value is 0,640.

Light Sensor




When Alex robot was placed in relatively semi lit area, without any obstacles the value is 64902,65158,64903 when the robot was placed in relatively semi lit area without any obstacels the value returned is 65063,65293,65096 When the robot is placed in a relatively dark room around 30 cm from the wall the values received were 65158,65283,65160 in light with the same distance from the wall, the value returned were 65100,65271,65106

Line Command

When the robot was placed on top of a white surface, the values returned were 0,0. Otherwise the values returned are 1,1.

Robot IR Command


Alex placed the scribbler everywhere in the classroom and it gives out (1,1), when he places the sensor very close to his shirt, it gives (0,0)

group members:
Richard Phillips
Akriti Sehrawat

I finally got a dongle today 9-8-12, so I will be testing it out very soon, so sit back and relax and other stuff


So above the current state of my myrotest file, which contains the commands needed to make my scribbler perform different tasks. On Monday, I was introduced to the while loop and the if/else statements.The While loop runs if the necessary criteria is satisfied and ends when the criterea set in place is no longer valid. The if/else statement is when a condition is being tested to see if it fals into the if statement. If it does then the scribbler performs the if statement. If not then it performs the else statement.

I first ran the command robot.getBAttery() which tells the robot to get the current battery level. I also made the terminal print out the code so that it would be displayed for me to view and contemplate.

Then i used the robot.getIR() command which told the robot to use it's IR sensors ,located on the end of the scribbler with the SC sticker. This result was also displayed on the terminal.

Next was the for loop, which repeats the command for the necessary amount of repititions depending on the parameters set. For my code, I set the value to 1, and had it stop when the n increased to 3, which had my robot turn 3 times. I also had my robot use the getLight command, which had the sensors located above the IR sensor to read a value 3 times and print out the value.

Next I utilize the robot's getLine code code with a while loop, so if my scribbler is on a light surface it will execute a command that has the robot beep and then move forward

Lastly I utilize the if/else statement. For my code I used, If the scribbler is on a dark surface it would execute the robot.getObject command which uses the fluke sensor to locate objects in front of the scribbler. If the scribbler is on a light surface it will disconnect when the while loop ends, but for my code this does not happen because the robot never stays on a light surface during the while loop.

Robots Got Talent Q and A

Link text

The song that my robot will sing is called Lets Go by Calvin Harris featuring Ne-Yo. This song is triggered by the battery level which I implemented using the robot get battery command and this command gave a value which I stored as a variable double. I then used an if/else condition statement with the battery level and the variable I caled battery. If the battery level was higher than 5.1 then it would play content in a for loop four times. Then i tested another condition with the robot's getLine command and if that condition was met the robot would continue the song, then finish.

Answer to question 2: The next portion was the drawing part. For this I had the robot draw the name ALF, which is a shorthand name of my robot alfred. I used the light sensor and a integer variable and the getLight in the center light senor area. I compared this value in a while loop with the value 70000, and if the light value is less it would draw. I also used a function to store a couple commands to make the code a bit easier to read and to become familiar with the feature. At the end of the while loop I set the new value of the variable "light" to 70001,which causes the while loop to stop and go to the next portion of the performance.

Answer to Question 3: The last portion is with the random function. For my program, I had the function return two values based on the IR sensor. I used the getIR command from the robot. I also printed out the getObstacle command and displayed it on the terminal. The boolean value stored as variable asdf, will run a while loop, so long as the variable is true,which i represented as 1. IF the random function generates a value that is not equal to 1 the program will run the else statement which has the robot move in increments which corrolate to the num two variable that stores values between 1 and 2.

Answer to question 4

Umm I answered it somewhat earlier in this section, but to be frank, I sed different value types ex: int,boolean,double, and loops and structures with conditions that would be met for a certain peroid of time, then would end because of a new value I produced with a variable.I also had a function implemented into the code. I am glad that this assignment went smoothly as other people were not so fortunate.

Lab 9/26/12

File download

The group members involved are:Jessie,Henry,Wayne, and myself. The code that was implemented in the lab is displayed above as a link. I was able to use the paranoid function to make my robot turn when it was in darkness and move forward in light.

Pre Lab Q

On Day 8, we had the Robot Games. Jesse Chand, Adrian Mendoza, Tam Henry Le Nguyen, and I formed team "Wu Tang" to compete in the hopes of a gold medal.
1. Write a description of your robots performance for the Opening Ceremony. What is your algorithm and sensors used for this event? Collectively, the class will spell out the letters U-S-C. Our teams robots will be a part of the letter U. The algorithm we used was assigning each position along U, a number. Specifically, my robot is in the eighth position of the formation. To reach the position, the robot will be controlled via user input. Using WASD will move the robot, and F will stop it. This is activated through the light sensor. If the user presses Q, the robot will sing the Fight Song. This is to be done in unison with all of the other robots.
2. Write a description of your robots Line Following behavior. What is your algorithm and sensors used for this event? The robot will use an infinite while loop to follow the line. The body of the while loop consists of an If, Else If, and Then statement. \ First the robot will check to see if its left sensor returns 0 for white if it does then it adjusts itself till the line sensors report 1,1. It does the same for the right sensor. Then if the sensors do return 1,1, then it just moves forward. Basically, the robot always tries to get itself back to its line sensors being 1,1.
3. Write a description of your robots Maze Solving ability. What is your algorithm and sensors used for this event? The robot will use an infinite for loop in order to solve the maze. It starts by moving forward. If it sees an obstacle through the obstacle sensor, it moves left. From there, it checks to see if there is another obstacle - if so, it will turn right by 180 degrees. This is because the robot assumes that there must be a rightward path, since the left is obstructed. From there, it will continue to move forward and repeat the logic.
4. Write a description of your robots Fastest Drawer behavior. What is your algorithm and/or sensors used for this event? The robot will draw the triangles without going over any lines. I used three different forward amounts for each triangle. Since each triangle has a 120 degree turn radius,i used mots with number -1 and 1 for left and 1,-1 for right turns. Other than that I used the IR sensor in a if else statement to utilize this sensor.
5. Write a description of what is your algorithm for structuring your robot teams behaviors. Upon running the program, the user is given a menu in the Terminal. The user can then press the numbers 1 - 4 in order to select an action. Each action is given its own function, so by pressing a number, the program calls the appropriate function.

Lab 6

Today we did a lab on arrays. Here is the code for the array lab. LinkCode


Here is the search and rescue code and stuff. Write a description of your teamís USAR strategy. What is your algorithm and sensors used for this task? Our team is mostly using the camera to have the robot understand its environment. The robot will gradually inch forward, just like the Moon rovers. After slightly moving, it will take a picture if the user wishes. Then, the user can compare the pictures to judge movement and make further decisions from there. Thus, the process is very modular. At each Ďstepí the user can choose to move, turn, take a picture, or view a slideshow. Write a description of your robotís performance for navigating through the mock disaster area. What is your algorithm and sensors used for this sub-¨-problem? We are making our robots move slowly around the area and we will command it to take a picture whenever we want to. By doing so, we will be able to view the area and see how we can keep the robot moving or searching. We are using the picture sensor and char inputs. Write a description of your robotís locating lost scribblers behavior. What is your algorithm is to sensors used for this sub-¨-problem? The algorithm is to wait for user input. Then move towards a location, and take a picture. If a robot is spotted, the user will respond with the yes input. Then the image is modified through the coordinates that the user inputs. Lastly, a slideshow is made. Write a description of your teamís mapping strategy. What is your algorithm for this task? Our mapping strategy is to move around and search for the missing robots using the camera to take pictures. Moving from left to right generally. Our algorithm is using user input to control the movement and the camera to take pictures while storing the pictures in an array and mapping on a created picture.

Final Project

Question 1: The CS topic that I am trying to teach is the ability to teach programming through the use of games. This can be accomplished through the tic tac toe game that I created in C++, to make learning about c++ fun and engaging. To be able to teach and demonstrate the games, I used tic tac toc with user input to make it interesting.

Question 2: My program will engage the user by having them selecting a space to occupy by either a X or O tile. Then I had the players alternate. When one of the conditions is met in the win function the if/else statement commences. This causes either player 1 or player 2 to win.

Question 3: For developing human user interface I had the program display a board which would act as the tic/tac/toe board.

Question 4: I will evaluate the human user interface using if/else statements. I will also use Boolean variables and functions to evaluate the human user interface.

Question 5: I will evaluate the user interaction by using an if/else statement to determine which space was occupied. I will also use a character array to determine which square is selected and the winning condition.

Question 6: It will collect user interaction information in an array to be evaluated for winning conditions.

Question 7: I would use an array to store the variable after player 1 or player 2 has won the game.

Valid XHTML 1.0 Transitional!Valid CSS!

The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees