Skip to main content

DEBUGINvariable

Syntax

DEBUGIN variable

Description

Normally the programs running on an ARMstamp are running stand-alone and without direct human input.  However, during the bringup phase a programmer may want to try different values.  So a simplified replacement of the normal BASIC INPUT has been added, called DEBUGIN.

Another way to change values is to use the > execute statement immediately operation.

INPUT is used to control the direction of one of the 16 IO pins.

DEBUGIN has a limited edit capacity: it allows to erase characters using the backspace key. If a better user interface is needed, a custom input routine should be used.

DEBUGIN may also read a string from the control serial port.

Example

DIM yn$(10)

DO

PRINT
"Please enter a number:
";
DEBUGIN
a
PRINT "and
another ";
DEBUGIN
b

PRINT "Thank you"

SLEEP (500)
PRINT
PRINT "The total is "; a + b

PRINT
PRINT

DO

PRINT "Would
you like to enter some more
numbers";

DEBUGIN yn$

UNTIL (yn$(0) = "y") OR
(yn$(0) = "n")

UNTIL (yn$(0)
<> "y")

Differences from other BASICs

  • ARMstamp DEBUGIN can take numbers in hexadecimal, binary or decimal format by using $hex %bin
  • PBASIC is taylored for more interaction and allows more complex DEBUGIN
  • Visual BASIC calls this function INPUT

See also