There Is a Loop in the Procedure That Checks for Black Line

Yuna Kim

Esther Chung

F, January 7, 2005

Challenge 2

FOLLOW-LINE

Hypothesis

- We think that the number that the sensor reads is compared to a set number. When the sensor reads a number greater than the set number it will follow the black line. When the sensor reads a number less than the set number it will move so that it finds the black line.

- There is a loop in the procedure that checks for black line.

- The SciBorg turns left until the left sensor detects a black line. When the light is detected the SciBorg turns right until it detects a black line with the right sensor.

- The Sciborg will go straight only if the two sensor values are equal.

- The song is played when switch is turned on when the front bumper run into an object.

Experiments

1. Can SciBorg follow a red line?

No, the SciBorg does not follow a red line.

2. What happens if you place SciBorg on black paper? On the rug?

When you place the SciBorg on a black paper it goes in a straight line.

When you place the SciBorg on the rug it goes around in a circle and it tries to find a dark spot.

3. What number does the sensor read when it is on top of a black paper?

It reads approx. 100

4. What does the SciBorg do when it is not on top of a black line?

It makes a 360 degree turn until it finds the black line.

5. Type in "a, on" to see which wheel corresponds to it.

The left wheel is turned on and off by motor a

The right wheel is turned on and off by motor b

Conclusions

The SciBorg is operated under series of command.

to follow-line allows the SciBorg to move forward (it calls on the go-straight). It will also try to see if there is a black line or not (it calls on sees-black). If the left sensor value is greater than 100 the wheel will turn left and if the right sensor value is greater than 100 the wheel will turn right. The SciBorg goes back and forth to check for the black line. When the line ends the SciBorg will encounters white space. Since the sensor reads values that is less than 100 it makes a 360 turn until it finds a black spot. If the front bumper hits an object it will play a song.

Challenge 3

Hypothesis – refer to notebook

Experiments and Observation

a.  Changing the Blackness Threshold

i. 

b.  Swapping Sensors

i. 

c.  Swapping Motors

i. 

Challenge 4a

·  Create new menu “reverse-direction” and use command “rd” à only 7 menus allowed

·  Replace menu “stop-motion” with “reverse-direction” and use command “rd” à no change

·  Add command “rd” in global à no result

·  Output both switches 7 and 8 for menus “front-bumper?” and “back-bumper?” à no change

·  Instead of “rd”, use “thisway” & “thatway” in global

·  Use “thisway” & “thatway” in “go-forward” and “reverse-direction” à need to press back bumper twice before reverse for front bumper works

·  Change the reverse-direction to go-forward in the front-bumper

·  Change the go-forward to reverse-direction in the back-bumper

Challenge 4b

·  Change variable “black” to “light”

·  Create new global variable “follow-light”

·  Figure out which sensor ports to use à 2 & 3

·  Change output “:sensor-value > black” to “output :sensor-value < light”