[Coco] The CM17A "Firecracker" works on the Coco - Final CodeSample to wirelessly control all 256 X10 Units.

K. Pruitt pruittk at roadrunner.com
Sun Feb 15 07:22:27 EST 2015


230 IF B=1 THEN U=INT(U/2)

should be

230 IF B=1 THEN U=INT(U-8)


My apologies for the initial error.  That was from a brain on no sleep and 
it was kind of a quick and lazy way to connect the upper and lower banks of 
the house/unit codes.

With the new line 230 it will work as intended.  Still quick and lazy, but 
now correctly executed.

As soon as I got some proper rest, my error just popped in to my head when I 
wasn't even thinking about anything computer-related at all and certainly 
not a basic code snippet from nearly a month ago.  Amazing thing that 
subconscious mind.  Kind of slow, but apparently on the job 24/7.

By the way, this thread is for the one or two people who come in here once a 
year and ask about X10 stuff on the Coco.  So I ask for the List's 
indulgence in that regard and  I apologize for having to post this 
correction taking up yet more space.  But I couldn't let my error go 
unaddressed.


----- Original Message ----- 
From: "K. Pruitt" <pruittk at roadrunner.com>
To: <Coco at maltedmedia.com>
Sent: Thursday, January 22, 2015 11:34 PM
Subject: [Coco] The CM17A "Firecracker" works on the Coco - Final CodeSample 
to wirelessly control all 256 X10 Units.


<SNIP>
>
>
> 100 '* CM17A "Firecracker" BASIC Interface for the Color Computer
> 110 '* Allows simple wireless control of all 256 X10 Units
> 120 '* This is demo code and contains no error handling
> 130 CLS
> 140 DIM LB(16):DIM UB(16):DIM O(8):DIM F(8)
> 150 FOR D=1 TO 16:READ LB(D):NEXT D
> 160 FOR D=1 TO 16:READ UB(D):NEXT D
> 170 FOR D=1 TO 8:READ O(D):NEXT D
> 180 FOR D=1 TO 8:READ F(D):NEXT D
> 190 '* Get User Input
> 200 INPUT "HOUSE   (A-P)        :";H$
> 210 INPUT "UNIT    (1-16)       :";U:IF U>8 THEN B=1 ELSE B=0
> 220 INPUT "COMMAND (O)N OR OF(F):";C$
> 230 IF B=1 THEN U=INT(U/2)
> 240 '* Process Housecode
> 250 IF B=0 THEN H=ASC(H$)-64:H=LB(H) ELSE IF B=1 THEN H=ASC(H$)-64:H=UB(H)
> 260 '* Process Command
> 270 IF C$="O" THEN C=O(U)ELSE IF C$="F" THEN C=F(U)
> 280 '* Send Header (Header never changes)
> 290 X=&HD5:GOSUB 360:X=&HAA:GOSUB 360
> 300 '* Send Housecode/Unit Code, then Command Code
> 310 X=H:GOSUB 360:X=C:GOSUB 360
> 320 '* Send Footer (Footer never changes)
> 330 X=&HAD:GOSUB 360
> 340 END
> 350 '* Convert to binary and procces it to the CM17A as 8'S and 1'S
> 360 FOR L=7 TO 0 STEP-1
> 370 P=2^L:P=INT(P)
> 380 IF X>=P THEN X=X-P:POKE &HFF6A,8 ELSE POKE &HFF6A,1
> 390 '* Put the CM17A in standby mode between signals
> 400 POKE &HFF6A,&H0D
> 410 NEXT L
> 420 RETURN
> 430 '*
> 440 '* House Codes - Lower Bank A-P 1-8
> 450 DATA &H60,&H70,&H40,&H50,&H80,&H90,&HA0,&HB0
> 460 DATA &HE0,&HF0,&HC0,&HD4,&H00,&H10,&H20,&H30
> 470 '* House Codes - Upper Bank A-P 9-16
> 480 DATA &H64,&H74,&H44,&H54,&H84,&H94,&HA4,&HB4
> 490 DATA &HE4,&HF4,&HC4,&HD0,&H0A,&H14,&H23,&H34
> 500 '* Command Codes - ON AND OFF
> 510 DATA &H00,&H10,&H08,&H18,&H40,&H50,&H48,&H58
> 520 DATA &H20,&H30,&H28,&H38,&H60,&H70,&H68,&H78
>
>
> -- 



More information about the Coco mailing list