Tel: +44 7814 044 754 -  Fax: +44 8715 283 948 -  Skype: warburtech.co.uk

Add to Favourites

BASIC Stamp BS1-IC Instruction Set

The following gives a complete list of PBASIC commands for this version of the BASIC Stamp. It does not include arithmetic or logical operators.
BRANCHING
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC IF . . .THEN Compare and conditionally branch.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC BRANCH Branch to address specified by offset.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC GOTO Branch to address.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC GOSUB Branch to subroutine at address.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC RETURN Return from subroutine.
LOOPING
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC FOR . . . NEXT Establish a FOR - NEXT loop.
NUMERICS
BS1-IC LET Perform variable manipulation, such as A=5, B=A+2, etc. Possible operations are add, subtract, multiply, divide, max. limit, min. limit, and logical operations AND, OR, XOR, AND NOT, OR NOT, and XOR NOT.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC LOOKUP Lookup data specified by offset and store in variable. This instruction provides a means to make a lookup table.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC LOOKDOWN Find target's match number (0-N) and store in variable.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC RANDOM Generate a pseudo-random number.
DIGITAL I/O
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC INPUT Make pin an input.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC OUTPUT Make pin an output.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC REVERSE If pin is an output, make it an input. If pin is an input, make it an output.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC LOW Make pin output low.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC HIGH Make pin output high.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC TOGGLE Make pin an output and toggle state.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC PULSIN Measure an input pulse.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC PULSOUT Output a timed pulse by inverting a pin for some time.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC BUTTON Debounce button, perform auto-repeat, and branch to address if button is in target state.
ASYNCHRONOUS SERIAL I/O
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC SERIN Serial input with optional qualifiers and variables for storage of received data. On the BS1-IC, baud rates of 300, 600, 1200, and 2400 are possible. On the BS2-IC, any baud rate (up to 50k baud) is possible. Also, the BS2-IC has a serial input time-out function.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC SEROUT Send data serially. On the BS1-IC, data is sent at 300, 600, 1200, or 2400 baud. On the BS2-IC, data is sent at any baud rate (up to 50k baud).
ANALOGUE I/O
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC PWM Output PWM, then return pin to input. This can be used to output analogue voltages (0 to 5 V) using a capacitor and resistor.
BS1-IC POT Read a 5 to 50K potentiometer and scale result.
SOUND
BS1-IC SOUND Play notes. Note 0 is silence, notes 1 to 127 are ascending tones, and notes 128 to 255 are white noises.
EEPROM ACCESS
BS1-IC EEPROM Store data in EEPROM before downloading BASIC program.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC READ Read EEPROM byte into variable.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC WRITE Write byte into EEPROM.
TIME
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC PAUSE Pause execution for 0 to 65536 milliseconds.
POWER CONTROL
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC NAP Nap for a short period. Power consumption is reduced.
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC SLEEP Sleep for 1 to 65535 seconds. Power consumption is reduced to 20 µA (BS1-IC) or 50 µA (BS2-IC).
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC END Sleep until the power cycles or the PC connects. Power consumption is the same as SLEEP instruction.
PROGRAM DEBUGGING
BS1-ICBS2-ICBS2E-ICBS2SX-ICBS2P24-IC DEBUG Sends variables to PC for viewing.

Page Updated:
22/12/09

Mastercard Visa Credit Solo Visa Debit JCB Visa Electron Maestro
Acceptance Mark

Tel: +44 7814 044 754 -  Fax: +44 8715 283 948 -  Skype: warburtech.co.uk

Warburton Technology, 33 Selkirk Close, Wimborne, Dorset, BH21 1TN, United Kingdom

VAT Number: GB 846 917 877

Warburton Technology