Remote-processing BASIC 52 Uživatelský manuál Strana 69

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 68
RPBASIC-52 PROGRAMMING GUIDE
2-50
KEYPAD
Syntax: A = KEYPAD(function)
Where: function = 0 or 1
0 = return keypad position pressed from buffer
1 = returns number of keys in buffer
Function: Returns keypad pressed position or number of keys in keypad buffer.
Mode: Command, Run
Use: A = KEYPAD(0) Returns a keypad position
Cards: All
DESCRIPTION
The keypad is automatically scanned, debounced, and placed in an 8 position buffer in the background. Key
presses are buffered until retrieved by the KEYPAD(0) function. Keypad positions are returned as a number
from 1 to 24. W hen a 0 is returned, there are no more keys in the bu ffer.
Position numbers 1 - 4 correspond to the top row while positions 12 - 16 are the bottom row of keys on the
KP-1 and KP-3 keypads. Thus, the letter 'B' on the KP-1 corresponds to position 8.
Use CL EAR KEYPAD to remove all characters from the buffer.
ON KEYPAD branches to a subroutine when a key is pressed. (check card for availability)
RELATED
CLEAR KEYPAD, ON KEYPAD
ERROR
BAD DATA When function is out of range.
EXAMPLE
The following program prints out the keypad position as a key is pressed.
10 CLEAR KEYPAD
20 DO
30 UNTIL KEYPAD(1) = 1
40 PRINT KEYPAD(0)
50 GOTO 20
Zobrazit stránku 68
1 2 ... 64 65 66 67 68 69 70 71 72 73 74 ... 162 163

Komentáře k této Příručce

Žádné komentáře