Very simple event viewer
Mumfy
Posts: 4
Hello all,
I'm still really new at this, so be kind.
I needed something that would show if a sensor I was testing was triggering under different conditions.
It's a simple program, and needs a bit of work.
First of all, when the lines get to the bottom of the screen is there a way to either clear the old info, or shift the lines up?
Thanks!
I'm still really new at this, so be kind.
I needed something that would show if a sensor I was testing was triggering under different conditions.
It's a simple program, and needs a bit of work.
First of all, when the lines get to the bottom of the screen is there a way to either clear the old info, or shift the lines up?
Thanks!
Comments
~j
'===============================================
CON
_clkmode = xtal1 + pll8x
_xinfreq = 10_000_000 '10MHx + pll8x = 80MHx
tiles = gr#tiles - 1
'512x384
OBJ
gr : "vga graphics ASM"
PUB MainLoop|i'deg,x,y,mask,ii,char, h
gr.start
gr.pointcolor(1)
{///screen is 16 tiles across and 12 tall -starting at 0,0- ///}
repeat i from 16 to tiles
gr.color(i,$FF00) ' optional white on Black
repeat i from 0 to 15 'draws green line accross top of screen- 16 tiles
gr.color(i, $FF11)
gr.text(10,0,String("Event plotter t:" ))
plotting
PUB Plotting | x,y,y1,h,t
y:=45
repeat
y += 10 'go to next line
x := 0 'start at beginning
If y > 350 'if log has reached bottom of screen
y := 55 ' go back to top
repeat 500 'collect 500 data points
t++ 'increment time
x++ 'increment horizontal line
if ina[noparse][[/noparse]0] 'check if sense on 0
y1 := y-7
gr.color(7,||h?//$FF)
else
y1 := y
gr.color(7,$FF11)
gr.simplenum(512,0,t,0) 'SimpleNum(x,y,DecimalNumber,DecimalPoint)
repeat 400 'wait a moment
gr.pointcolor(0) 'set next lines to clear
gr.line(x,y,x,y-7) 'this clears current point
gr.line(x+10,y,x+10,y-7) 'this clears a small gap infront of current point
gr.simplenum(512,0,t,0) 'erase numbers so another can go on top
gr.pointcolor(1) 'set next lines to draw
gr.line(x,y,x,y1) 'draw new points