Shop OBEX P1 Docs P2 Docs Learn Events
New problem but older code — Parallax Forums

New problem but older code

Buck RogersBuck Rogers Posts: 2,187
edited 2016-01-30 18:19 in BASIC Stamp
Hello!
In this code block
' {$STAMP BS2}
' {$PBASIC 2.0}
 T2400       CON     396
LcdBaud CON T2400

'TX  PIN 15


'PL0  PIN     0    '
'PL1  PIN     1    '
LcdCls          CON     $0C             ' clear LCD (use PAUSE 5 after)
LcdBLoff        CON     $12             ' backlight off
LcdOff          CON     $15             ' LCD off
LcdOn1          CON     $16             ' LCD on; cursor off, blink off
LcdOn2          CON     $17             ' LCD on; cursor off, blink on
LcdOn3          CON     $18             ' LCD on; cursor on, blink off
LcdOn4          CON     $19             ' LCD on; cursor on, blink on
'
'
  X VAR Word
  Z VAR Word
  Z1 VAR Word
  X2 VAR Word
serdata  VAR  Byte

'SEROUT 15, LcdBaud, [LcdBLoff, LcdOn1, LcdCls]
'  PAUSE 5
Main:
'
FOR X=1 TO 192
'SERIN 0, LcdBaud, [Z]
'DEBUG Z, X
'SEROUT 1, LcdBaud, [Z]
'SEROUT 15, LcdBaud, [Z]
'serdata=serdata + 1
GOSUB Calcstamp
'
'PULSOUT 14,50
'PULSOUT 14, X
'SEROUT 15, LcdBaud, [X]
'SEROUT 1, LcdBaud, [X]
'PAUSE 250
Z1=Z +128
X2=Z1 +128
'
'SEROUT 1, LcdBaud, [Z1]
'SEROUT 15, LcdBaud, [Z1]
'SEROUT 1, LcdBaud, [X2]
'SEROUT 15, LcdBaud, [X2]
'
'DEBUG Z1, X2
'serdata=serdata + 1
GOSUB CalcStamp
NEXT
END
CalcStamp:
SERIN 14, 396,[serdata]
serdata=serdata + 1
SEROUT 14, 396,[serdata]
SEROUT 2, 396,[serdata]
SEROUT 3, 396,[serdata]
DEBUG DEC serdata, CR
RETURN

The stuff enclosed in the CalcStamp subroutine only works if the other portions are commented out. This is not what the fellow who originally wrote the program that became that subroutine wanted. I refer all of you here . That there is the original page that spawned the efforts of connecting any BS2 device to a TI83Plus calculator with minimal effort.

He wanted us to expand on the original program to have it do things of almost any sort. But what I originally had in mind last year starting about late April was in connecting a Netduino who's made by Secret Labs to BS2 to work on a particular problem and display what was happening on an ordinary LCD display who happened to be a Parallax #27977.

That worked as it happens. My next plans were to add the calculator I/O function to the whole idea and then allow the numerical data generated by the that code block
CalcStamp:
SERIN 14, 396,[serdata]
serdata=serdata + 1
SEROUT 14, 396,[serdata]
SEROUT 2, 396,[serdata]
SEROUT 3, 396,[serdata]
DEBUG DEC serdata, CR
RETURN
to further assist the whole business in deciding what to do next.

Sadly the original project was tabled because of other problems. Here I am the following year and I've decided to see if the whole business works. It only works if the serial functions outside of the subroutine are commented out. I'm looking for advice as to why.

One more thing, I've already ruled out a power problem as the batteries used by the BASIC Stamp are practically new. The one for the other guy, is being replaced. More on that later.
----
Strange no robot here. He's moving again.

Comments

  • Before anyone prepares to comment or complain, I've decided to swap the TI83Plus for this
    one:
    It's the "2-Axis Joystick" with stock #27800.

    I figure that the degrees of resolution produces are reasonably better then the few numbers that the calculator produces using those two programs on it, and the BASIC code on the BS2. An update will be posted soon.
Sign In or Register to comment.