Shop OBEX P1 Docs P2 Docs Learn Events
PENGUIN ROBOT Scout Compass - the Code — Parallax Forums

PENGUIN ROBOT Scout Compass - the Code

HumanoidoHumanoido Posts: 5,770
edited 2007-10-22 02:21 in Robotics
Penguin Scout Compass
Turns Penguin into a day/night scouting field compass
penguin_scout_compass.bpx


This code turns Penguin robot into the compass master!
Carry around the little bot as it reports compass readings
directly on the bright blue digital display. This code enables
actual display of all directions - North, South, East, and West.

humanoido

' SCOUT COMPASS
' will report directions in the field just by turning Penguin in
' any direction. With Penguin and SCOUT COMPASS, you are never lost.
' Penguin knows how to find the South Pole! Uses Penguins' on board
' display to see reported directions. Uses graphics characters.

' The Penguin Scout Compass is multifunctional. It works day or
' night, and operates in the field without a pc computer.
' It will function in the field by displaying graphics on Penguins'
' display. This can be as accurate as the calibration, as Penguin is
' moved around to the center point of the directions range.
'
' Penguins display is bright, and would serves well as a direction
' finder on a cloudy dark night or even in bright sunlight.
' NOTE: the compass should be calibrated for accurate results. If
' calibration is off, the compass will still function but the
' reported direction will be off.

' The compass routine has an embedded range of degrees on either
' side of "true diection." To operate, Penguin is moved in one
' direction until the display changes, then in the opposite
' side until the direction icon changes again. Then, half way in
' between these two can be taken as the direction reported.
'
' Graphics are used to display
' compass directions when north, south, east, or west is reached.
' Graphics represented are shown below. The icons for
' South, East and West are an open cup in the direction if you were
' facing North (see below). True North is represented by an arrows'
' straight line. The orientation for reading the display is the same
' as Penguins' view. Stand behind Penguin, and this is how you see
' the display correctly.
'
'
' NORTH  |
'        |
'
'         __
' SOUTH  |  |
'
' (...CONTINUES ON PROGRAM LISTING...)
'
' Directions are as follows
'
' 0   - North
' 90  - East
' 180 - South
' 270 - West
' 360 - North
Sign In or Register to comment.