122-28029 Parallax Inc, 122-28029 Datasheet - Page 210

GUIDE STUDENT SMART SENSORS

122-28029

Manufacturer Part Number
122-28029
Description
GUIDE STUDENT SMART SENSORS
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-28029

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Smart Sensors
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Page 198 · Smart Sensors and Applications
Try the game first, and then we’ll take a closer look at how it works.
Example Program – TiltObstacleGame.bs2
' -----[ Title ]--------------------------------------------------------------
' Smart Sensors and Applications - TiltObstacleGame.bs2
' Tilt accelerometer to guide cursor through maze, collect $ in Debug Terminal
'{$STAMP BS2}
'{$PBASIC 2.5}
' -----[ EEPROM Data ]--------------------------------------------------------
' Store background to EEPROM
Maze DATA @0, HOME,
"#####################", CR,
"######
"##
"#
"#$
"#####
"#
"# $
"#
"#
"#####################", CR
YouLose DATA @243, HOME,
"#####################", CR,
"#####################", CR,
"###
"###
"#####################", CR,
"########## ##########", CR,
###########
##$##
########### #
##
Open (or enter) and save TiltObstacleGame.bs2.
Before you run the program, make sure your board is level. Also, make sure you
are holding it the same way you did in Activity 3, with the breadboard closest to
you, and the serial cable furthest away.
If you want to refresh the “$” characters, click your BASIC Stamp Editor’s Run
button. If you want to just practice navigating and not worry about points, press
and release the Reset button on your board.
#
#
#######
#######
###
Free Download! This program is available as a free .bs2 file download from the Smart
Sensors and Applications Product Page at www.parallax.com.
$
########
$ #####WIN", CR,
##
########", CR,
$
####", CR,
#
####", CR,
####", CR,
###", CR,
###", CR,
#", CR,
#", CR,
#", CR,
#", CR,
' Stamp/PBASIC directives
' 3 backgrounds used in game
' Maze background
' YouLose background

Related parts for 122-28029