Shop OBEX P1 Docs P2 Docs Learn Events
Uppdate Inputs and present on VGA! — Parallax Forums

Uppdate Inputs and present on VGA!

Johan1968Johan1968 Posts: 22
edited 2008-02-10 19:27 in Propeller 1
I cant get the input message to uppdate wen i press and get the P7 High and do it in realtime, only wen i reset the prop.
These two Msh wanted i to change wen i the input changes to hig/low: " Input at Pin 7 "/ " No Input at Pin 7 "

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
High = 1
Low = 0
Out = %1
In = %0


OBJ

text : "vga_text"


PRI CheckForInput
'
DIRA[noparse][[/noparse]7] := In
DIRA[noparse][[/noparse]0] := Out
'
PUB start | i

'' $00 = clear screen
'' $01 = home
'' $08 = backspace
'' $09 = tab (8 spaces per)
'' $0A = set X position (X follows)
'' $0B = set Y position (Y follows)
'' $0C = set color (color follows)
'' $0D = return

'start term
text.start(16)
text.str(string(13," VGA Text Demo...",13,13,$C,5," OBJ and VAR require only 2.6KB ",$C,1))
repeat 14
text.out(" ")
text.out(i)
text.str(string($C,6," Uses internal ROM font ",$C,2))

If InA[noparse][[/noparse]7] == High
dira[noparse][[/noparse]0]~~
text.str(string($C,13,$0B,6,$0A,8," Input at Pin 7 "))
OutA[noparse][[/noparse]0] := High
repeat
text.str(string($A,13,$B,10))
text.dec(i++)
repeat

Else
text.str(string($C,13,$0B,6,$0A,8," No Input at Pin 7 "))

OutA[noparse][[/noparse]0] := Low
repeat
text.str(string($A,13,$B,10))
text.dec(i++)
repeat

Regards Johan

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 19:27
     If InA[noparse][[/noparse]7]
        dira[noparse][[/noparse]0]~~
        text.str(string($C,13,$0B,6,$0A,8," Input at Pin 7 "))         
        OutA[noparse][[/noparse]0] := High
      repeat
        text.str(string($A,13,$B,10))
        text.dec(i++)
      repeat
    
    



    The last repeat will stop your program. (Edit: The last but one also smile.gif )
    Please try to post your code as all others do it here! Indentation is most important with SPIN

    Post Edited (deSilva) : 2/10/2008 8:01:26 PM GMT
Sign In or Register to comment.