Remote-processing CAMBASIC Manuel d'utilisateur Page 120

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 208
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 119
Commands - 87
ON INP
Tasking Statement
SYNTAX: ON INP n, address, mask, compare GOSUB line/label
PURPOSE: To cause an interr upt when a preset inpu t bit pattern is detected in an inpu t port.
REMARK S: The task is similar to ON BIT. However, you can look at any or all of the 8 bits on a port. An
interrupt occurs when the bit pattern is recognized.
The interrupt will occur on the first instance of the pattern match. It will not interrupt again until the
inputs change and then change back to match the pattern. This is sometimes called an “edge
triggered” mode.
The parameter n is the task number. It ranges from 0 to 7.
The address is the I/O address of the port to be read.
The mask parameter determines which bits are of interest. Each bit in the mask that is a “1” is a bit
of interest.
When the data at the port matches the compare parameter, an interrupt occurs and the program
branches to the line/label. Up to 8 conditions may be tested on the same por t or differ ent ports
See the Multitasking Chapter for more information.
RELATED: START INP, STOP INP
EXAMPLE: 10 ON INP 0,3,7,5 GOSUB 60
20 START INP 0
30 PRINT BIN$(INP(0))
40 DELAY .25
50 GOTO 30
60 PRINT "match"
70 RETURN
ERROR: < Data negative> all parameters
< Data out of range> if n>7
< Data > 255> for mask and compare
< Data > 65,535> for address
< Can’t compile> if line/label not found
Vue de la page 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 207 208

Commentaires sur ces manuels

Pas de commentaire