28125 Parallax Inc, 28125 Datasheet - Page 239

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
You can also change the denominator into a constant like this:
Then, in your Average_And_Difference subroutine, you can replace 6 (or the optimum
value that you determined) with the
You can also use one less variable in this program. Notice that the only time the
average
Denominator
needed later, but the
simply use the
and you would no longer need the
look:
Instead of the value 6, try dividing the
and 9.
Run the program and test the Boe-Bot’s ability to exit a dark room with each
denominator value.
Decide what the optimum denominator value is.
Average_And_Difference:
Denominator CON 6
Average_And_Difference:
Make the changes just discussed, and verify that the program still works
correctly.
Average_And_Difference:
variable is used is to temporarily hold the average value, then it gets divided by
average = timeRight + timeLeft / 2
difference = average / 6
RETURN
average = timeRight + timeLeft / 2
difference = average / Denominator
RETURN
difference = timeRight + timeLeft / 2
and stored in the
difference
average
variable in place of the
variable is not. One way to fix this problem would be to
difference
average
Denominator
variable. Here is how the subroutine would
average
variable. The
constant, like this:
average
variable by the values 3, 4, 5, 7,
variable. It will work fine,
difference
variable is

Related parts for 28125