Vous êtes sur la page 1sur 5

ECEN4213

Lab 1

Computer Based System Design

ECEN 4213
Computer Based System Design
Lab 1: Introduction to the BASIC Stamp Editor
Max
Points

Ex #

Doc

Points
Earned

Instructor
Initial

Grading criteria
Bonus points

(1.0) ______

Program entered correctly, downloads


and runs

(0.5) ______

Completed Exercise 1
Program entered correctly, downloads
and runs

(3.5) ______
(0.5) ______

Completed Exercise 2
Program entered correctly, downloads
and runs

(4.5) ______
(0.5) ______

Completed Exercise 3

(5.5) ______

Documentation and comments

(5.0) ______

TOTAL:

In order to receive credit for this laboratory exercise, please submit this handout (in
its entirety) to your lab instructor when you are finished.

Fall (2002)

Page 1 of 5

Tuesday, September 17, 2002

ECEN4213

Lab 1

Computer Based System Design

DESCRIPTION
Upon completion of this exercise you will have gained experience using the BASIC Stamp Editor
to send messages to the PC screen. You will also learn the various ways to format your messages
and outputs to be displayed.
Exercise 1
1. Plug the RS-232 cable to the serial port of the Board of Education (BOE).
2. Connect the power source.
3. Start the BASIC Stamp II Windows Editor by clicking on the Stampw icon on the
desktop.
4. Using the BASIC Stamp II Windows Editor, type the following:
'{$STAMP BS2}
Debug
Debug
Debug
Debug
Debug
End

Hello there.
How are you?, cr
rep -\20, cr
I am fine,, tab, Thank you, cr
rep +\20

5. Write the output you see on the Debug terminal below:

Fall (2002)

Page 2 of 5

Tuesday, September 17, 2002

ECEN4213

Lab 1

Computer Based System Design

Exercise 2
1. Using the BASIC Stamp II Windows Editor, type the following:
'{$STAMP BS2}
b0=100
b1=-65
w2=-100
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
Debug
End

? b0
b0, cr
asc ? b0
bin ? b0
ihex b0, cr
ibin b0, cr
? b1
sdec b1, cr
sdec5 w2, cr
The value of b0 is , dec b0, in Decimal, cr
The value of b0 is , bin b0, in Binary, cr
rep +\20, cr
This is , Boring!
rep +\20, cr

2. Write the output you see on the Debug terminal below:

Fall (2002)

Page 3 of 5

Tuesday, September 17, 2002

ECEN4213

Lab 1

Computer Based System Design

Exercise 3

1. Given the following values:


a. X=65
b. Y=$7E
c. Z=-65
2. Using the variables given above, write the PBASIC code that will produce the following
output on the Debug terminal:

---------------- ECEN 4213 ---------------Class: Computer Based System Design


This is my first PBASIC Program!
-----------------------------------------------Decimal value of X is: 65
X = 65
Hexadecimal value of Y is: 7E
Y = $7E
Binary value of X is: 1000001
X = %1000001
ASCII character of X is: A
X = A
ASCII character of Y is: ~
Y = ~
Z (Signed):
-00065
-$0041
Z (Unsigned): 65471
$FFBF

-%0000000001000001
%1111111110111111

--------------------THE END----------------

Fall (2002)

Page 4 of 5

Tuesday, September 17, 2002

ECEN4213

Lab 1

Computer Based System Design

3. Write your code below:

Submission
Submit this handout to your lab instructor. Make sure your code is thoroughly commented.
NOTE:

Fall (2002)

Failure to submit this handout to your lab instructor will result in the grade of
zero for this lab.

Page 5 of 5

Tuesday, September 17, 2002

Vous aimerez peut-être aussi