home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 April / CHIP4_98.ISO / software / ccconrad / basic.exe / CHIP / Programme.Bas / Beispiele_2 / ALARM.BAS next >
Encoding:
BASIC Source File  |  1997-04-16  |  895 b   |  46 lines

  1. '**************************************
  2. '
  3. ' C-Control/BASIC       ALARM.BAS
  4. '
  5. ' Aufgabe:
  6. '
  7. ' - Alarmanlage fuer acht Eingaenge
  8. ' - Anzeige ueber LED
  9. ' - Ausgabe an Sirene abschaltbar
  10. '
  11. '**************************************
  12. ' --- Definitionen --------------------
  13.  
  14. define E1 port [9]
  15. define E2 port [10]
  16. define E3 port [11]
  17. define E4 port [12]
  18. define E5 port [13]
  19. define E6 port [14]
  20. define E7 port [15]
  21. define E8 port [16]
  22.  
  23. define Sirene port [1]
  24. define LED    port [2]
  25. define Sperre port [3]
  26.  
  27. define Alarm  byte
  28.  
  29. ' --- Programmoperationen -------------
  30.  
  31. #Loop
  32.      'E1 bis E4 aktiv low
  33.   Alarm = not (E1 and E2 and E3 and E4)
  34.      'E5 bis E8 aktiv high
  35.   Alarm = Alarm or E5 or E6 or E7 or E8
  36.      'Ausgabe der Alarmzustands an LED
  37.   LED = Alarm
  38.      'Ausgabe an Sirene?
  39.   Sirene = Alarm and not Sperre
  40. goto Loop              'Endlosschleife
  41.  
  42.  
  43.  
  44.  
  45.  
  46.