home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / control / homecon / x10test.bas < prev   
BASIC Source File  |  1988-02-18  |  1KB  |  23 lines

  1. 10000 DEFINT A-Z                : REM make everybody here integers
  2. 10100 REM ----- this stuff must be done just once at the start
  3. 10200 INTNUM = &H63             : REM X10 interrupt number
  4. 10300 REM fetch the X10 interrupt vector
  5. 10400 DEF SEG=0
  6. 10500 INTOFFS = 4*INTNUM        : REM figure vector offset
  7. 10700 XOFF=256*PEEK(INTOFFS+3)+PEEK(INTOFFS+2)  : REM get X10 vector
  8. 10800 XSEG=256*PEEK(INTOFFS+3)+PEEK(INTOFFS+2)
  9. 10900 IF (XOFF <> 0) AND (XSEG <> 0) GOTO 11500
  10. 11000 PRINT "X10DRIVE isn't installed!"
  11. 11100 STOP
  12. 11500 X10=&H104                 : REM set BASIC CALL entry offset
  13. 11600 DEF SEG=XSEG              : REM  ... and segment
  14. 12000 REM ----- now for the useful code
  15. 12100 HOUSE=ASC("A")            : REM CALL parameter must be an integer!
  16. 12200 UNIT=1                    : REM unit from 0 - 16
  17. 12300 ACTION=1                  : REM action from 0 - 6
  18. 12400 PRINT "Making the call!"
  19. 12500 CALL X10(HOUSE,UNIT,ACTION)
  20. 12600 PRINT "Return code is",HOUSE
  21. 12700 REM ----- repeat the above as needed
  22. 12800 STOP
  23.