27404 Parallax Inc, 27404 Datasheet - Page 54

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
binary value from the right is accessed with
with
Here is an
odd or even in ResetButtonCounter.bs2:
ACTIVITY #2: USING AND REUSING VARIABLES
The next example program demonstrates how you can do many different tasks with three
variables. It will prompt you to enter a threshold value, after which, it will prompt you to
enter up to 20 more values. To enter your values, click the Transmit windowpane shown
in Figure 2-3. Then type each value and press the enter key. When you are done entering
values, press the 0 (zero) key, then press Enter. The program will then ask you if you
want to compare the values to the threshold you entered. If you respond by pressing the
"y" key, the program will display all the values you entered and compare them to the
threshold value you entered.
.BIT2
IF temp.BIT0 = 0 THEN
ELSE
ENDIF
Save ResetButtonCounter as ResetButtonCounterYourTurn.bs2
Insert the odd/even
program.
Run the program, and verify that it correctly identifies each successive value of
temp as odd or even.
DEBUG DEC temp, " is even.", CR
DEBUG DEC temp, " is odd.", CR
IF...THEN
, and so on.
statement you can use to determine whether the value of
IF...THEN
statement just before the
.BIT1
; the third binary value is accessed
END
command in the
temp
is

Related parts for 27404