28824 Parallax Inc, 28824 Datasheet - Page 6

SERVOPAL SERVO PULSER TIMER

28824

Manufacturer Part Number
28824
Description
SERVOPAL SERVO PULSER TIMER
Manufacturer
Parallax Inc
Datasheet

Specifications of 28824

Accessory Type
Servo Motor Control
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
BASIC Stamp®
For Use With
28803 - KIT BOARD OF EDU W/O PWR SUPP
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Simple Example Program
Here’s a simple-minded BS2 program that moves a BOE-Bot forward for 5 seconds, then in reverse for
five seconds, using the Alarm output as a timer:
' =========================================================================
'
'
'
'
'
'
'
'
'
'
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
' This simple demo of the ServoPAL, when used with a BOE-Bot, will move the
' robot forward for five seconds, then in reverse for five seconds.
' -----[ I/O Definitions ]-------------------------------------------------
nInp
Alarm PIN 13
' -----[ Initialization ]--------------------------------------------------
INPUT nInp
DO : LOOP UNTIL nInp
LOW nInp
PAUSE 100
HIGH nInp
PAUSE 100
' -----[ Program Code ]----------------------------------------------------
PULSOUT nInp, 500
PULSOUT nInp, 1000
PULSOUT nInp, 50
DO : LOOP UNTIL Alarm
PULSOUT nInp, 1000
PULSOUT nInp, 500
PULSOUT nInp, 50
DO : LOOP UNTIL Alarm
PULSOUT nInp, 2000
PULSOUT nInp, 2000
DO:LOOP
IR Roaming Program
The next example is an IR roaming program for the BOE-Bot. To use this program, you should connect
the IR emitters and sensors as shown in Parallax’s Robotics with the Boe-Bot , figure 7-4 (copied below).
© Parallax, Inc. • ServoPAL (2007.10.30)
File...... ServoPAL_Simple_Demo.bs2
Purpose... Demonstrate ServoPAL capabilites on a BOE-Bot
Author.... Parallax, Inc.
E-mail.... support@parallax.com
Started... 2007.05.01
Updated... 2007.10.29
{$STAMP BS2}
{$PBASIC 2.5}
PIN 12
'Program right servo for full forward.
'Program left servo for full forward.
'Program alarm for 5 seconds.
'Wait for Alarm.
'Program right servo for full reverse.
'Program left servo fro full reverse.
'Program alarm for 5 seconds.
'Wait for Alarm.
'Turn right servo off.
'Turn left servo off.
'Define the input pin.
'Define the alarm pin.
'Make sure nInp isn't being driven.
'Wait for ServoPAL to power up.
'Set pin to an output and hold it low
'
'Raise the pin.
for 100mS to reset ServoPAL.
Page 6 of 9

Related parts for 28824