'Andijk 3-10-1997 'this basic program i use for 5x7 or 5x8 LED Dot Matrix fonts 'it shows the hex valeu 'so it makes it easier to change the font on the propellor clock 'Luberth DECLARE SUB EditPattern () DECLARE SUB Initialize () DECLARE SUB ShowPattern () DIM Bit%(0 TO 7), Pattern$, Esc$ Initialize EditPattern END ' SUB EditPattern STATIC SHARED Pattern$, Esc$, Bit%() ByteNum% = 1 'Starting position. Bitnum% = 0 Null$ = CHR$(0) 'CHR$(0) is the first byte of the 'two-byte string returned when a 'direction key such as UP or DOWN is 'pressed. DO ShowPattern X% = ((ByteNum%) * 16) + 234 Y% = 30 + (Bitnum% - 10) * -8 State% = 0 RefTime = 0 DO IF ABS(TIMER - RefTime) > .3 THEN RefTime = TIMER State% = 2 - State% 'Turn the border of bit on and off: LINE (X% - 1, Y% - 1)-STEP(15, 8), State%, B END IF Check$ = INKEY$ LOOP WHILE Check$ = "" LINE (X% - 1, Y% - 1)-STEP(15, 8), 0, B SELECT CASE Check$ CASE CHR$(27) EXIT SUB CASE CHR$(32) CurrentByte% = ASC(MID$(Pattern$, ByteNum%, 1)) CurrentByte% = CurrentByte% XOR Bit%(Bitnum%) MID$(Pattern$, ByteNum%) = CHR$(CurrentByte%) IF (CurrentByte% AND Bit%(Bitnum%)) <> 0 THEN CurrentColor% = 0 ELSE CurrentColor% = 2 END IF LINE (X% + 1, Y% + 1)-STEP(11, 4), CurrentColor%, BF CASE Null$ + CHR$(75) ByteNum% = ByteNum% - 1 IF ByteNum% < 1 THEN ByteNum% = 5 CASE Null$ + CHR$(77) ByteNum% = ByteNum% + 1 IF ByteNum% > 5 THEN ByteNum% = 1 CASE Null$ + CHR$(72) Bitnum% = Bitnum% + 1 IF Bitnum% > 7 THEN Bitnum% = 0 CASE Null$ + CHR$(80) Bitnum% = Bitnum% - 1 IF Bitnum% < 0 THEN Bitnum% = 7 CASE ELSE END SELECT LOOP END SUB ' SUB Initialize STATIC SHARED Pattern$, Esc$, Bit%() Esc$ = CHR$(27) FOR I% = 0 TO 7: Bit%(I%) = 2 ^ I%: PRINT Bit%(I%): NEXT I% Pattern$ = STRING$(8, 255) SCREEN 8: CLS FOR a = 1 TO 8 X% = 250: Y% = 30 + (a + 2) * 8 FOR J% = 1 TO 5 LINE (X%, Y%)-STEP(13, 6), 8, B X% = X% + 16 NEXT J% NEXT a LOCATE 19, 20: PRINT "DIRECTION keys........Move cursor" LOCATE 20, 20: PRINT "SPACEBAR............Changes point" LOCATE 21, 20: PRINT "ESC.........................Quits"; LOCATE 23, 5: PRINT "Luberth@worldaccess.nl www.worldaccess.nl/~luberth" END SUB ' SUB ShowPattern SHARED Pattern$ LOCATE 1, 15: PRINT "The following characters make up your pattern:" a = 5 FOR I% = 1 TO 5 PatternByte% = ASC(MID$(Pattern$, I%, 1)) LOCATE 15, 45: PRINT "Hex: " LOCATE 15, 45 + a: PRINT " " LOCATE 15, 45 + a: PRINT HEX$(PatternByte%) B$ = HEX$(PatternByte%) a = a + 4 NEXT I% END SUB