Hi all.

So I'm working on a project; a BASIC program that talks at 4800 baud to a
LaserDisc player.  The commands are sent as ascii text, with a carriage
return at the end, and responses are similarly a text string terminating in
a CR.

On my Tandy 200, I'm able to configure the port in TERM via:
   STAT 78N1DNI

And then i can type out commands and the player works and responds with the
correct responses... so I know the serial line is working in both
directions as designed.

In BASIC, i know i need to open the connection for INPUT and OUTPUT so that
I can write stuff and read back the responses.  The following code works to
send out the commands, but it gets errors no matter what I try for reading
in the response

10 OPEN "COM:78N1DNI" FOR OUTPUT AS 1
20 ON COM GOSUB 100
30 COM ON
40 REM Send seek to frame 1000
50 PRINT #1, "FR1000SE"
60 REM when the player gets there, it responds "R<CR>" via serial
70 GOTO 70
100 REM Got serial response
110 A$=INPUT #1
120 PRINT "Got ", A$
130 RETURN

I looked around in a few online T books, but couldn't really find anything
that could help me out on this one, and I'm feeling pretty stupid that me,
a web applications and embedded systems engineer can't figure out a BASIC
program.... It's been YEARS since I messed around with BASIC, and even then
I never really did much with opening files...

sidenote, "ON COM GOSUB <xxx>" ?!?! That's an awesome feature!  I love that
we can have interrupt-driven serial in BASIC!

Side-sidenote; I also don't really have a good solution yet for saving and
restoring the files but i'll probably just do serial port dumps or
somesuch. ;D I know i can buy NADS or REX or something, for file offloading
but this is a short-term project for Maker Faire next month, and I don't
have the cash to drop on fancy stuff right now.  I'll probably just throw
together a serial-terminal based SD card shell using a spare arduino or
something...   Although I'd gladly trade my Booster Pak which i never
really got working for one of those... ;D

-s

-- 
Scott Lawrence
[email protected]

Reply via email to