Wednesday, May 20, 2009

Ch. 17-- Logic


This chapter took a while to fully understand. The logic block is an advanced block with many uses. THe logic block takes a yes/no response from other blocks via data wires and interprets them based on what you tell it to do. The logic block has a drop down menu with four options: And, Or, Xor, and Not. For the and option, both responses must be yes for a final yes to be generated from the logic block. For the or option, only one response must be yes for a final response of yes. For the Xor option, only one plug can be yes for a final yes value. For the not option, plug A is reversed and plug B will be disabled. Data wires must be connected for the logic block to work. The Logic block has 3 data ports. A port A, a port B, and a yes/no output. Take a sensor or anything else you want to use logic on, and and take a data wire and connect it to a or b.

Patrol Robot: Continue Lamp Challenge




This part of the continue phase involved putting a lamp onto the robot and having it flash when the door is open. Also, you had to incorporate a my block into the program in the lamp part. To do this, I had to add a lamp to my robot and set up a new program. My program is shown below for both the my block and the main program. To get the programming right, I used lamp then wait blocks set for 1 second then the lamp would go off then wait for 1 second. All of these lamp and wait blocks were put into a loop and set to stop when the touch sensor is pressed.

Patrol Robot: Continue Bluetooth Challenge




The first part of the patrol robot continue phase was bluetooth communication. It recommended looking at another page which explained all of the bluetooth techniques so I looked at that and figured out how to get the bluetooth connected and write simple programs with that. The challenge for this section was to have the robot detect if a door is open or closed and then send a message to another nxt saying that the door is open or closed. This program involved using data wires and bluetooth send and receive blocks. The main part of the program with the bluetooth blocks is shown below if you want to see it. The receiving robot had a simple receive message block with a data wire going to a display block.

Monday, May 18, 2009

Day 4: Obstacle course

Thinking back on the obstacle course, I thought I did pretty well. I ended up finishing a day early and my robot was able to complete all of the challenges. I had a fairly stable robot design which curved to the right a little bit but I compensated for this by changing the turns and starting position. My program was also very organized because of my use of my blocks. This saved me a lot of time and trouble in the long run because I didnt have to repeat parts of the program and troubleshoot if one of those repeats went wrong. I unfortunately got some points off of my program because I didn't label my program. I ended up winning the most accurate course completion because I used the strategy of slow and steady. All of my turns were very precise. There is a video on the Day 3 blog for anyone interested.

Thursday, May 14, 2009

Patrol Robot: Contemplate


The purpose of the patrol robot is to detect if the doors in a building are open or closed. The robot makes use of all the sensors to do this. It starts out going forward until the light sensor detects a dark line. Then, it waits again until there is light to make sure the robot crosses the line. The robot then turns left and uses a switch block to detect whether the distance is greater or less than 15 cm. If the distance is less, the door is closes and the ultrasonic sensor is detecting the door. If the door is open, the ultrasonic sensor detects the back wall which is greater than 15 cm. If the door is closed, the robot turns right and proceeds to the next black line. If the door is open, it plays an alert sound until the touch sensor is pressed. A loop is placed around all of this to make the robot continue this behavior forever. This saves time because you don't have to re-write the whole program every time you want the robot to repeat these actions. The program shown gives you an idea of the block used.

Patrol Robot: Construct



Recently, i've been working on a robot called the patrol robot. It uses a completely different design than the taskbot. It kind of resembles a dog and it even has a tail. It also makes use of all the sensors and very small wheels. The design seems to be very modular and stable. A difference between this robot and the taskbot is that the free rotating wheel is at the back rather than at the front.

Monday, May 4, 2009

Day 3 of the Obstacle Course



Today, I was able to run the robot on the course and get full marks and an extra 3 bonus points for finishing it a day early. I got some points taken off for my program not being labeled. Before I ran the course, I had to make some small adjustments to the turn after bumping the wall and the distance the robot backed up. Also, Today, My robot started pulling to the right so I had to take into consideration where to start my robot. There were evenly spaced lines on the starting line so I could consistently start in the same spot and figure out what the problem was consistently. I have since worked on my program to clean it up a little and label everything and I hope to go for neatest program.