Remote-processing BASIC 52 Instrukcja Użytkownika Strona 61

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 163
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 60
RPBASIC-52 PROGRAMMING GUIDE
2-42
BAD DATA When channel is out of range for a card.
EXAMPLE
The following example sets up frequency multitaskin g and prints the counts received in a time interval.
10 LINEB 6,1,32
20 LINEB 6,1,72 : REM Reset counter and enable inputs
30 CONFIG FREQ 0,200 : REM Get count every second (5 ms * 200)
40 C = 5/56000 : REM Constant using Greyhill module. 5V / 56000Hz = V/Hz
50 CLEAR TICK(0)
60 IF TICK(0) < 1 THEN 40 : REM Wait for a second
70 A = FREQ(0) : REM Get frequency
80 V = (A-14400) * C : REM Multiply by constant to get Voltage
90 PRINT "Voltage = ",V, "Frequency =",A
100 GOTO 50
You may need to add a 1K ohm pull up resistor from the output of the Greyhill module to the input of the
counter. The input rise time should be 1 micro-second or faster.
Przeglądanie stron 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 162 163

Komentarze do niniejszej Instrukcji

Brak uwag